Commit Graph

36870 Commits

Author SHA1 Message Date
Benjamin Trent a26a80c89c
Simple rename of unreleased quantization parameter (#12811) 2023-11-15 15:00:12 -05:00
Benjamin Trent 05a336ea69
Utilize exact kNN search when gathering k > numVectors in a segment (#12806)
When requesting for k >= numVectors, it doesn't make sense to go through the HNSW graph. Even without a user supplied filter, we should not explore the HNSW graph if it contains fewer than k vectors.

One scenario where we may still explore the graph if k >= numVectors is when not every document has a vector and there are deleted docs. But, this commit significantly improves things regardless.
2023-11-15 12:56:15 -05:00
Adrien Grand 5afc17d4b5
Close all files when hitting an I/O exception with vectors. (#12807)
This was found by `testRandomExceptions()`: if an exception occurs when opening
the meta file, then the `rawVectorsReader` that is passed to the constructor
never gets closed.
2023-11-15 08:42:08 +01:00
Adrien Grand a13a4224d8 New attempt at addressing testHasUncommittedChanges() failures. 2023-11-14 23:11:54 +01:00
Uwe Schindler b45c21f9db
Fix errorprone with alternative runtime (#12808) 2023-11-14 22:56:55 +01:00
Michael McCandless 1ebee9e611
Remove angry errant lurking semicolons (#12805)
* remove angry errant lurking semicolons

* tidy

* #12805: woops, put back ; from autogen'd QueryParser.java
2023-11-14 12:34:46 -05:00
Alan Woodward dd46971ba6 Add CHANGES entry for #12801 2023-11-14 14:28:18 +00:00
Davis Cook 72dbfb7cf2
fix large p99 match request latency when purgeCache is running (#12801)
Prevent contention on the ReentrantReadWriteLock at search time by
ensuring that `commit` and `purgeCache` are never both trying to
hold the write lock.
2023-11-14 13:58:05 +00:00
Mike McCandless 63759a463d #12715: remove deprecated FSTCompiler constructor since this is an experimental/internal API 2023-11-14 08:35:46 -05:00
Juan Manuel Caicedo Carvajal df07febfe8
Deprecated public constructor of FSTCompiler in favor of the Builder. (#12715)
* Deprecated public constructor of FSTCompiler in favor of the Builder.

* Updated javadoc and added entry to CHANGES.txt
2023-11-14 08:30:04 -05:00
Mike McCandless cc35e90355 remove another errant lurking angry semicolon -- why do I keep finding these? 2023-11-14 07:07:52 -05:00
zhouhui 27c8e3f13f
Add downloading binutils instructions for the macos. (#12804) 2023-11-14 05:51:51 -05:00
Greg Miller 117e8d3435
Ensure DrillSidewaysScorer calls LeafCollector#finish on all sideways-dim FacetsCollectors (#12640) 2023-11-13 16:35:53 -08:00
Dzung Bui 1999353d9e
Copy directly between 2 ByteBlockPool to avoid double-copy (#12786)
* Copy directly between 2 ByteBlockPool to avoid double-copy

* add a comment on the start address

* Add unit test for NodeHash

* tidy code
2023-11-13 12:35:37 -05:00
Jakub Slowinski fcf6878144
javadocs cleanup in Lucene99PostingsFormat (#12776)
Addressing the last comments from https://github.com/apache/lucene/pull/12741
2023-11-13 11:07:21 -05:00
Shubham Chaudhary be27303e3a
Minor change to IndexOrDocValuesQuery#toString (#12791) 2023-11-13 10:01:32 -05:00
Stefan Vodita a70432c110
[Minor] Improvements to slice pools (#12795)
1. Remove rest method used only in tests.
2. Update Javadocs.
3. Make interleaved slices test a bit more evil by adding pool resets.
2023-11-13 09:42:01 -05:00
Mike McCandless 14196cfcf7 remove errant lurking semicolon 2023-11-13 08:26:50 -05:00
Chris Hegarty f2287e7ba6
Refactor the use of runFinalization in tests and benchmarks (#12768)
This commit refactors the usage of the deprecated System::runFinalization in tests and benchmarks, so that narrowly targeted suppressions can be added.
2023-11-13 10:21:53 +00:00
Adrien Grand 1930425ffa Tidy. 2023-11-13 10:23:19 +01:00
Adrien Grand c081cfa0ba Use a serial merge scheduler to avoid race conditions when checking for hasPendingMerges().
Closes #12763
2023-11-13 10:01:39 +01:00
Benjamin Trent 4e2ce76b3e Merge remote-tracking branch 'upstream/main' 2023-11-10 14:38:14 -05:00
Benjamin Trent fe0ccbd84a Fixing changes for GITHUB#12729 2023-11-10 14:37:56 -05:00
Patrick Zhai 72ec96b1d1
Fix NFAQuery in TestRegexpRandom2 (#12793) 2023-11-10 11:17:35 -08:00
Benjamin Trent a47ba3369f
Refactoring HNSW to use a new internal FlatVectorFormat (#12729)
Currently the HNSW codec does too many things, it not only indexes vectors, but stores them and determines how to store them given the vector type.

This PR extracts out the vector storage into a new format `Lucene99FlatVectorsFormat` and adds new base class called `FlatVectorsFormat`. This allows for some additional helper functions that allow an indexing codec (like HNSW) take advantage of the flat formats.

Additionally, this PR refactors the new `Lucene99ScalarQuantizedVectorsFormat` to be a `FlatVectorsFormat`.

Now, `Lucene99HnswVectorsFormat` is constructed with a `Lucene99FlatVectorsFormat` and a new `Lucene99HnswScalarQuantizedVectorsFormat` that uses `Lucene99ScalarQuantizedVectorsFormat`
2023-11-10 14:05:19 -05:00
Robert Muir c28d174cd7
script to run microbenchmarks across different ec2 instance types (#12787) 2023-11-10 12:31:10 -05:00
gf2121 d4583567e9
Cache buckets to speed up BytesRefHash#sort (#12784) 2023-11-10 16:13:41 +08:00
Patrick Zhai 904a994f66
Enable executing using NFA in RegexpQuery (#12767) 2023-11-09 23:12:42 -08:00
Egor Potemkin e1af4182d6
Fix random test TestDirectoryTaxonomyReader#TestDirectoryTaxonomyReader (#12790) 2023-11-09 14:08:44 -05:00
Uwe Schindler 41c19d8c7e Rename test to fit the name of MMapDirectory 2023-11-09 18:45:57 +01:00
Uwe Schindler 5b43384367
Redo #12707: Do not rely on isAlive() status of MemorySegment#Scope and make sure IndexInput#close() does not throw IllegalStateException and waits instead (#12785) 2023-11-09 18:40:10 +01:00
Mike McCandless 2cd66fb311 #12180: move CHANGES entry to 9.9.0 section 2023-11-09 10:36:43 -05:00
Egor Potemkin fb5f491643
Add TaxonomyReader#getBulkOrdinals method (#12180) (#12769) 2023-11-09 10:02:02 -05:00
Zhang Chao 570832eb74
Specialize arc store for continuous label in FST (#12748)
* init

* review fix and reuse duplicate code

* rebase

* tidy

* CHANGES.txt

* bump version

* rebase

* CHANGES.txt
2023-11-09 06:01:32 -05:00
Lu Xugang a71d64a598
Skip docs with Docvalues in NumericLeafComparator (#12405)
* Skip document by docValues

*When the queue is full with only one Comparator, we could better tune the maxValueAsBytes/minValueAsBytes. For instance, if the sort is ascending and bottom value is 5, we will use a range on [MIN_VALUE, 4].
---------

Co-authored-by: Adrien Grand <jpountz@gmail.com>
2023-11-09 13:05:28 +08:00
Stefan Vodita 8665014fa8
Clean up ordinal map in default SSDV reader state (#12454) 2023-11-08 17:07:22 -08:00
Kevin Rosendahl ddb01cacd4
Normalize written scalar quantized vectors when using cosine similarity (#12780)
### Description

When using cosine similarity, the `ScalarQuantizer` normalizes vectors when calculating quantiles and `ScalarQuantizedRandomVectorScorer` normalizes query vectors before scoring them, but `Lucene99ScalarQuantizedVectorsWriter` does not normalize the vectors prior to quantizing them when producing the quantized vectors to write to disk. This PR normalizes vectors prior to quantizing them when writing them to disk.

Recall results on my M1 with the `glove-100-angular` data set (all using `maxConn`: 16, `beamWidth` 100, `numCandidates`: 100, `k`: 10, single segment):
| Configuration | Recall | Average Query Duration |
|---------------|-------|-----------------| 
| Pre-patch no quantization | 0.78762 | 0.68 ms |
| Pre-patch with quantization | 8.999999999999717E-5 | 0.45 ms |
| Post-patch no quantization | 0.78762 | 0.70 ms |
| Post-patch with quantization | 0.66742 | 0.66 ms |
2023-11-08 14:26:48 -05:00
Mike McCandless 20d5de448a Revert "Copy directly between 2 ByteBlockPool to avoid double-copy (#12778)"
This reverts commit efd68f8165.
2023-11-08 11:14:32 -05:00
Dzung Bui efd68f8165
Copy directly between 2 ByteBlockPool to avoid double-copy (#12778)
* Copy directly between 2 ByteBlockPool to avoid double-copy

* Use TestUtil in test case

* Rename variables

* Rename methods
2023-11-08 11:09:45 -05:00
Jakub Slowinski f698f90171
Re-adding the backward_codecs.lucene90 TestPForUtil + TestForUtil (#12781)
Clean-up from adding the Lucene99PostingsFormat in https://github.com/apache/lucene/pull/12741
These test cases were moved to Lucene99 dir and I forgot to copy the unmodified versions for the backward_codecs.lucene90
2023-11-08 09:01:47 -05:00
Dawid Weiss c85529b2c0
TestIndexWriterOnVMError.testUnknownError times out (fixes potential IW deadlock on tragic exceptions). (#12751) 2023-11-08 09:47:19 +01:00
Jakub Slowinski f416b2b8b5
Fix nested link warning from renderSiteJavadoc (#12779) 2023-11-07 11:24:43 -05:00
Benjamin Trent 34d858fbbb Fix KnnQueryTestCase
Both testEuclidean and testExplain have vectors that result
in equal scores. Since we no longer tie break on vector ordinal
as it doesn't make sense when building the graph, the vectors returned
might be slightly different. This commit fixes the flaky nature of the
test.
2023-11-07 07:55:28 -05:00
Benjamin Trent e1ce1d692c
Stop exploring HNSW graph if scores are not getting better. (#12770)
I noticed while testing lower dimensionality and quantization, we would explore the HNSW graph way too much. I was stuck figuring out why until I noticed the searcher checks for distance equality (not just if the distance is better) when exploring neighbors-of-neighbors. This seems like a bad heuristic, but to double check I looked at what nmslib does. This pointed me back to this commit: nmslib/nmslib#106

Seems like this performance hitch was discovered awhile ago :).

This commit adjusts HNSW to only explore the graph layer if the distance is actually better.
2023-11-07 06:55:42 -05:00
Dzung Bui 3231028070
remove FST's BytesReader#reversed() (#12777) 2023-11-07 05:11:27 -05:00
Robert Muir eab3e502bb
disable vectors (and don't warn to add incubator module) for jvmci/graal (#12766) 2023-11-06 15:28:22 -05:00
Dzung Bui 0e9c23785e
Streamline FST constructors and make it fully read-only (#12758)
* Streamline FST constructors

* Let init return the FSTStore

* Change constructor visibility
2023-11-06 12:34:39 -05:00
Jakub Slowinski 8ae598bae5
Remove patching for doc blocks. (#12741)
* Change Postings back to using FOR in Lucene99PostingsFormat

We are still keeping PFOR for positions only.
This is a partial revert of https://github.com/apache/lucene/pull/69 which brings back ForDeltaUtil.

* fix merge commit

* Add forgotten forDeltaUtil calls to reader

* Addressing comments: adding Lucene90RWPostingsFormat + more

Also:
* Change to Changes.txt
* Removal of dead code which was only used in unit tests
* Removal of test code from PForUtil

* Changes.txt edit in right place now

* Apply suggestions from code review: `90 -> 99 refactoring`

Co-authored-by: gf2121 <52390227+gf2121@users.noreply.github.com>

* Remove decodeTo32 from ForUtil and regenerate

---------

Co-authored-by: gf2121 <52390227+gf2121@users.noreply.github.com>
2023-11-06 10:46:03 -05:00
Mike McCandless 3acc3c864a #12506: escape > in javadocs 2023-11-06 10:41:01 -05:00
Mike McCandless 2a31f2835c #12506: switch to TestUtil for random ints to be consistent with 9.x backport where Java 11 doesn't have this API 2023-11-06 08:41:06 -05:00