Skip to content

Conversation

@kundadebdatta
Copy link
Member

@kundadebdatta kundadebdatta commented Oct 19, 2024

Pull Request Template

Description

This PR adds a new FullTextPolicy in ContainerProperties and a new FullTextIndexes in the IndexingPolicy to enable Full Text Search in Cosmos DB.

Below is a sample for the new ContainerProperties with Full Text Indexing Policy andFull Text Policy highlighted.

{
	"indexingPolicy": {
		"automatic": true,
		"indexingMode": "Consistent",
		"additionalIndexPolicy": "indexpolicyvalue",
		"includedPaths": [
			{
				"path": "/included/path",
				"additionalIncludedPath": "includedPathValue",
				"indexes": [

				]
			}
		],
		"excludedPaths": [
			{
				"path": "/excluded/path",
				"additionalExcludedPath": "excludedPathValue"
			}
		],
		"compositeIndexes": [
			[
				{
					"path": "/composite/path",
					"additionalCompositeIndex": "compositeIndexValue",
					"order": "ascending"
				}
			]
		],
		"spatialIndexes": [
			{
				"path": "/spatial/path",
				"additionalSpatialIndexes": "spatialIndexValue",
				"types": [

				]
			}
		],
		"fullTextIndexes": [
			{
				"path": "/fullTextPath1",
				"additionalFullTextIndex": "fullTextIndexValue1"
			},
			{
				"path": "/fullTextPath2",
				"additionalFullTextIndex": "fullTextIndexValue2"
			},
			{
				"path": "/fullTextPath3"
			}
		]
	},
	"computedProperties": [
		{
			"name": "lowerName",
			"query": "SELECT VALUE LOWER(c.name) FROM c"
		},
		{
			"name": "estimatedTax",
			"query": "SELECT VALUE c.salary * 0.2 FROM c"
		}
	],
	"geospatialConfig": {
		"type": "Geography",
		"additionalGeospatialConfig": "geospatialConfigValue"
	},
	"uniqueKeyPolicy": {
		"additionalUniqueKeyPolicy": "uniqueKeyPolicyValue",
		"uniqueKeys": [
			{
				"paths": [
					"/unique/key/path/1",
					"/unique/key/path/2"
				]
			}
		]
	},
	"conflictResolutionPolicy": {
		"mode": "LastWriterWins",
		"additionalConflictResolutionPolicy": "conflictResolutionValue"
	},
	"clientEncryptionPolicy": {
		"includedPaths": [
			{
				"path": "/path",
				"clientEncryptionKeyId": "clientEncryptionKeyId",
				"encryptionType": "Randomized",
				"additionalIncludedPath": "includedPathValue",
				"encryptionAlgorithm": "AEAD_AES_256_CBC_HMAC_SHA256"
			}
		],
		"policyFormatVersion": 1,
		"additionalEncryptionPolicy": "clientEncryptionpolicyValue"
	},
	"id": "2a9f501b-6948-4795-8fd1-797defb5c466",
	"partitionKey": {
		"paths": [

		],
		"kind": "Hash"
	},
	"fullTextPolicy": {
		"defaultLanguage": "en-US",
		"fullTextPaths": [
			{
				"path": "/fullTextPath1",
				"language": "en-US"
			},
			{
				"path": "/fullTextPath2",
				"language": "en-US"
			},
			{
				"path": "/fullTextPath3",
				"language": "en-US"
			}
		]
	}
}

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Closing issues

To automatically close an issue: closes #4820

@kundadebdatta kundadebdatta self-assigned this Oct 19, 2024
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good!

@kundadebdatta kundadebdatta changed the title Initial code changes to introduce full text search. [Internal] ContainerProperties: Adds Full Text Search and Indexing Policy Oct 19, 2024
@kundadebdatta kundadebdatta added Do Not Review Marks a PR in "work in progress" state. DO NOT MERGE labels Oct 19, 2024
Copy link
Member

@Pilchie Pilchie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but would like to see tests actually run, and an additional test case.

@kundadebdatta kundadebdatta requested a review from a team as a code owner October 22, 2024 00:54
@kundadebdatta kundadebdatta added full-text-search and removed Do Not Review Marks a PR in "work in progress" state. labels Oct 22, 2024
@kundadebdatta kundadebdatta added the auto-merge Enables automation to merge PRs label Oct 23, 2024
@kirankumarkolli kirankumarkolli merged commit 89c79a2 into master Oct 23, 2024
23 checks passed
@kirankumarkolli kirankumarkolli deleted the users/kundadebdatta/4820_add_full_text_search_indexing_policy branch October 23, 2024 00:49
}
}

/// <inheritdoc/>
Copy link
Contributor

@dibahlfi dibahlfi Oct 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to override GetHashCode()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge Enables automation to merge PRs full-text-search

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Full Text Search] - Introduce new Indexing Policy for Full Text Search

7 participants