Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Sep 5, 2024

Conversation

navneet1v
Copy link
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: John Mazanec <[email protected]>
Signed-off-by: John Mazanec <[email protected]>
Copy link
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
29 checks passed
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 <[email protected]>

* fix release notes

Signed-off-by: John Mazanec <[email protected]>

* Remove commented out code

Signed-off-by: John Mazanec <[email protected]>

---------

Signed-off-by: Navneet Verma <[email protected]>
Signed-off-by: John Mazanec <[email protected]>
Co-authored-by: John Mazanec <[email protected]>
(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 <[email protected]>

* fix release notes

Signed-off-by: John Mazanec <[email protected]>

* Remove commented out code

Signed-off-by: John Mazanec <[email protected]>

---------

Signed-off-by: Navneet Verma <[email protected]>
Signed-off-by: John Mazanec <[email protected]>
Co-authored-by: John Mazanec <[email protected]>
(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 <[email protected]>

* fix release notes

Signed-off-by: John Mazanec <[email protected]>

* Remove commented out code

Signed-off-by: John Mazanec <[email protected]>

---------

Signed-off-by: Navneet Verma <[email protected]>
Signed-off-by: John Mazanec <[email protected]>
Co-authored-by: John Mazanec <[email protected]>
(cherry picked from commit cb9ba71)

Co-authored-by: Navneet Verma <[email protected]>
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 <[email protected]>

* fix release notes

Signed-off-by: John Mazanec <[email protected]>

* Remove commented out code

Signed-off-by: John Mazanec <[email protected]>

---------

Signed-off-by: Navneet Verma <[email protected]>
Signed-off-by: John Mazanec <[email protected]>
Co-authored-by: John Mazanec <[email protected]>
(cherry picked from commit cb9ba71)

Co-authored-by: Navneet Verma <[email protected]>
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 <[email protected]>

* fix release notes

Signed-off-by: John Mazanec <[email protected]>

* Remove commented out code

Signed-off-by: John Mazanec <[email protected]>

---------

Signed-off-by: Navneet Verma <[email protected]>
Signed-off-by: John Mazanec <[email protected]>
Co-authored-by: John Mazanec <[email protected]>
Signed-off-by: Akash Shankaran <[email protected]>
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