Skip to content

Add spaceType as a top level parameter while creating vector field.#2044

Merged
navneet1v merged 3 commits intoopensearch-project:mainfrom
navneet1v:main
Sep 5, 2024
Merged

Add spaceType as a top level parameter while creating vector field.#2044
navneet1v merged 3 commits intoopensearch-project:mainfrom
navneet1v:main

Conversation

@navneet1v
Copy link
Copy Markdown
Collaborator

@navneet1v navneet1v commented Sep 5, 2024

Description

Add spaceType as a top level parameter while creating vector field. With this change a user can change the spaceType for the vector field without defining the method parameter in the mapping. With this change Disk based vector search OOB experience is improved.

Things to be added:

Tests will be added in followup PRs

How testing is done:

I have performed manual testing by running following create index request.

Success

{
	"settings": {
		"index": {
			"number_of_shards": 1,
			"number_of_replicas": 0,
			"refresh_interval": "1s",
			"knn": true
		}
	},
	"mappings": {
		"properties": {
			"my_vector2": {
				"type": "knn_vector",
				"dimension": 4,
				"mode": "on_disk",
				"compression_level": "32x",
				"space_type": "innerproduct"
			}
		}
	}
}

Success and hits the legacy method and use the innerproduct space type

{
	"settings": {
		"index": {
			"number_of_shards": 1,
			"number_of_replicas": 0,
			"refresh_interval": "1s",
			"knn": true
		}
	},
	"mappings": {
		"properties": {
			"my_vector2": {
				"type": "knn_vector",
				"dimension": 4,
				"space_type": "innerproduct"
			}
		}
	}
}

Related Issues

#1949

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Navneet Verma <navneev@amazon.com>
Signed-off-by: John Mazanec <jmazane@amazon.com>
Signed-off-by: John Mazanec <jmazane@amazon.com>
Copy link
Copy Markdown
Member

@jmazanec15 jmazanec15 left a comment

Choose a reason for hiding this comment

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

LGTM

@navneet1v navneet1v merged commit cb9ba71 into opensearch-project:main Sep 5, 2024
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 5, 2024
…2044)

* Add spaceType as a top level parameter while creating vector field.

Signed-off-by: Navneet Verma <navneev@amazon.com>

* fix release notes

Signed-off-by: John Mazanec <jmazane@amazon.com>

* Remove commented out code

Signed-off-by: John Mazanec <jmazane@amazon.com>

---------

Signed-off-by: Navneet Verma <navneev@amazon.com>
Signed-off-by: John Mazanec <jmazane@amazon.com>
Co-authored-by: John Mazanec <jmazane@amazon.com>
(cherry picked from commit cb9ba71)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 5, 2024
…2044)

* Add spaceType as a top level parameter while creating vector field.

Signed-off-by: Navneet Verma <navneev@amazon.com>

* fix release notes

Signed-off-by: John Mazanec <jmazane@amazon.com>

* Remove commented out code

Signed-off-by: John Mazanec <jmazane@amazon.com>

---------

Signed-off-by: Navneet Verma <navneev@amazon.com>
Signed-off-by: John Mazanec <jmazane@amazon.com>
Co-authored-by: John Mazanec <jmazane@amazon.com>
(cherry picked from commit cb9ba71)
naveentatikonda pushed a commit that referenced this pull request Sep 5, 2024
…2044) (#2050)

* Add spaceType as a top level parameter while creating vector field.

Signed-off-by: Navneet Verma <navneev@amazon.com>

* fix release notes

Signed-off-by: John Mazanec <jmazane@amazon.com>

* Remove commented out code

Signed-off-by: John Mazanec <jmazane@amazon.com>

---------

Signed-off-by: Navneet Verma <navneev@amazon.com>
Signed-off-by: John Mazanec <jmazane@amazon.com>
Co-authored-by: John Mazanec <jmazane@amazon.com>
(cherry picked from commit cb9ba71)

Co-authored-by: Navneet Verma <navneev@amazon.com>
ryanbogan pushed a commit that referenced this pull request Sep 5, 2024
…2044) (#2049)

* Add spaceType as a top level parameter while creating vector field.

Signed-off-by: Navneet Verma <navneev@amazon.com>

* fix release notes

Signed-off-by: John Mazanec <jmazane@amazon.com>

* Remove commented out code

Signed-off-by: John Mazanec <jmazane@amazon.com>

---------

Signed-off-by: Navneet Verma <navneev@amazon.com>
Signed-off-by: John Mazanec <jmazane@amazon.com>
Co-authored-by: John Mazanec <jmazane@amazon.com>
(cherry picked from commit cb9ba71)

Co-authored-by: Navneet Verma <navneev@amazon.com>
akashsha1 pushed a commit to akashsha1/k-NN that referenced this pull request Sep 16, 2024
…pensearch-project#2044)

* Add spaceType as a top level parameter while creating vector field.

Signed-off-by: Navneet Verma <navneev@amazon.com>

* fix release notes

Signed-off-by: John Mazanec <jmazane@amazon.com>

* Remove commented out code

Signed-off-by: John Mazanec <jmazane@amazon.com>

---------

Signed-off-by: Navneet Verma <navneev@amazon.com>
Signed-off-by: John Mazanec <jmazane@amazon.com>
Co-authored-by: John Mazanec <jmazane@amazon.com>
Signed-off-by: Akash Shankaran <akash.shankaran@intel.com>
jingqimao77-spec pushed a commit to jingqimao77-spec/k-NN that referenced this pull request Mar 15, 2026
…pensearch-project#2044)

* Add spaceType as a top level parameter while creating vector field.

Signed-off-by: Navneet Verma <navneev@amazon.com>

* fix release notes

Signed-off-by: John Mazanec <jmazane@amazon.com>

* Remove commented out code

Signed-off-by: John Mazanec <jmazane@amazon.com>

---------

Signed-off-by: Navneet Verma <navneev@amazon.com>
Signed-off-by: John Mazanec <jmazane@amazon.com>
Co-authored-by: John Mazanec <jmazane@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants