-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 AbstractKnnVectorQuery.seed for seeded HNSW #13635
Open
seanmacavaney
wants to merge
40
commits into
apache:main
Choose a base branch
from
seanmacavaney:seeds
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
60e3fab
implement seeded knn queries
82e7053
cleanup
7955148
ensure seed docs have a vector
40d972d
apply filter to seed queries
f36a4cd
Update lucene/core/src/java/org/apache/lucene/codecs/KnnVectorsReader…
seanmacavaney 539b29a
Update lucene/core/src/java/org/apache/lucene/codecs/KnnVectorsReader…
seanmacavaney 3df6ad2
Update lucene/core/src/java/org/apache/lucene/search/KnnByteVectorQue…
seanmacavaney 0508d87
Update lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphSear…
seanmacavaney 732f69c
Update lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphSear…
seanmacavaney c02b4cc
Update lucene/core/src/java/org/apache/lucene/search/AbstractKnnVecto…
seanmacavaney 285ebfe
Update lucene/core/src/java/org/apache/lucene/search/AbstractKnnVecto…
seanmacavaney b64d458
Merge branch 'main' into seeds
seanmacavaney 9f1be67
mapping docIds to ordinals
244f46b
fixed test warning
b73e7a3
fix test warning
3134132
tidy
69db4d4
Update lucene/core/src/java/org/apache/lucene/search/AbstractKnnVecto…
seanmacavaney fe4bef3
Update lucene/core/src/java/org/apache/lucene/search/KnnByteVectorQue…
seanmacavaney 8e044f8
Update lucene/core/src/java/org/apache/lucene/search/KnnFloatVectorQu…
seanmacavaney 33231b3
Update lucene/core/src/java/org/apache/lucene/index/FloatVectorValues…
seanmacavaney 2e86e4f
Update lucene/core/src/java/org/apache/lucene/index/ByteVectorValues.…
seanmacavaney c0c18b2
Update lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphSear…
seanmacavaney 6190aca
Update lucene/core/src/java/org/apache/lucene/util/hnsw/HnswGraphSear…
seanmacavaney a49ba2f
address review comments
8698b59
Merge branch 'main' into seeds
seanmacavaney 1f8a9f4
merge issues
58f34df
addresses review comments
fc2129f
refactor wip
e8417d3
consistent naming
440b0d0
javadoc
87e75ab
tidy
7b3350f
javadoc typo
5bb40c2
javadoc
216bfc4
test fixes
bccf15d
Merge branch 'main' into seeds
seanmacavaney b6725c7
merge resolution
0cfd99b
merging
dd63bb0
refactor as decorator
1635870
javadoc
c8a512a
apply decorator elsewhere
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ | |
import org.apache.lucene.index.SegmentReadState; | ||
import org.apache.lucene.index.VectorEncoding; | ||
import org.apache.lucene.index.VectorSimilarityFunction; | ||
import org.apache.lucene.search.DocIdSetIterator; | ||
import org.apache.lucene.search.KnnCollector; | ||
import org.apache.lucene.store.ChecksumIndexInput; | ||
import org.apache.lucene.store.DataInput; | ||
|
@@ -247,7 +248,12 @@ public ByteVectorValues getByteVectorValues(String field) throws IOException { | |
} | ||
|
||
@Override | ||
public void search(String field, float[] target, KnnCollector knnCollector, Bits acceptDocs) | ||
public void search( | ||
String field, | ||
float[] target, | ||
KnnCollector knnCollector, | ||
Bits acceptDocs, | ||
DocIdSetIterator seeds) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
throws IOException { | ||
search( | ||
fields.get(field), | ||
|
@@ -258,7 +264,12 @@ public void search(String field, float[] target, KnnCollector knnCollector, Bits | |
} | ||
|
||
@Override | ||
public void search(String field, byte[] target, KnnCollector knnCollector, Bits acceptDocs) | ||
public void search( | ||
String field, | ||
byte[] target, | ||
KnnCollector knnCollector, | ||
Bits acceptDocs, | ||
DocIdSetIterator seeds) | ||
throws IOException { | ||
search( | ||
fields.get(field), | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This question is perhaps a side effect of the history of this pull request and/or a naive question on my part: when do and don't we change the implementation of classes in the
backwards_codecs
(implementation other than signature) -- I note that here for 94 and 95 there are changes but for 92 there is no change. and 99 has no change (as yet). My speculation (but it is only that) is that perhaps the 94 and 95 changes need to move to 99 and that anything inbackwards_codecs
would get the method signature change only but no implementation change?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good points -- I think this is a question for @benwtrent?