Skip to content

[Internal] ContainerProperties: Adds Full Text Search and Indexing Policy#4837

Merged
kirankumarkolli merged 11 commits intomasterfrom
users/kundadebdatta/4820_add_full_text_search_indexing_policy
Oct 23, 2024
Merged

[Internal] ContainerProperties: Adds Full Text Search and Indexing Policy#4837
kirankumarkolli merged 11 commits intomasterfrom
users/kundadebdatta/4820_add_full_text_search_indexing_policy

Conversation

@kundadebdatta
Copy link
Copy Markdown
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
Copy Markdown

@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
Copy Markdown
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.

Comment thread Microsoft.Azure.Cosmos/src/Fluent/Settings/ContainerBuilder.cs Outdated
Comment thread Microsoft.Azure.Cosmos/src/Fluent/Settings/ContainerBuilder.cs Outdated
Comment thread Microsoft.Azure.Cosmos/src/Fluent/Settings/FullTextIndexDefinition.cs Outdated
Comment thread Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs Outdated
Comment thread Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs Outdated
Comment thread Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs Outdated
Comment thread Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs Outdated
Comment thread Microsoft.Azure.Cosmos/src/Resource/Settings/ContainerProperties.cs Outdated
Comment thread Microsoft.Azure.Cosmos/src/Resource/Settings/FullTextPolicy.cs Outdated
Comment thread Microsoft.Azure.Cosmos/src/Resource/Settings/FullTextPolicy.cs Outdated
Comment thread Microsoft.Azure.Cosmos/src/Resource/Settings/FullTextPolicy.cs Outdated
Comment thread Microsoft.Azure.Cosmos/src/Resource/Settings/FullTextPath.cs
Comment thread Microsoft.Azure.Cosmos/src/Fluent/Settings/ContainerBuilder.cs Outdated
@kundadebdatta kundadebdatta requested a review from a team as a code owner October 22, 2024 00:54
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

6 participants