Commit Graph

37438 Commits

Author SHA1 Message Date
Chris Hegarty 99488b2245
Ensure to use IOContext.READONCE when reading segment files (#13574)
This commit uses IOContext.READONCE in more places where the index input is clearly being read once by the thread opening it. We can then enforce that segment files are only opened with READONCE, in the test specific Mock directory wrapper.

Much of the changes in this PR update individual test usage, but there is one non-test change to Directory::copyFrom.
2024-07-17 08:56:11 +01:00
Mayya Sharipova 5e52b8094a
Add IntervalsSource for range and regexp queries (#13562)
We already have convenient functions for contructing IntervalsSource
for wildcard and fuzzy functions. This adds functions for
regexp and range as well.
2024-07-14 09:48:16 -04:00
Christine Poerschke c55d664b3e
in KnnVectorsWriter reduce code duplication w.r.t. MergedVectorValues.merge(Float|Byte)VectorValues (#13539)
Co-authored-by: Vigya Sharma <vigyaspeaks@gmail.com>
2024-07-12 10:48:10 +01:00
Christine Poerschke cc14555395
Lucene99HnswVectorsReader[.readFields] readability tweaks (#13532)
* remove unnecessary readFields parameter
* consistently use this. in constructor
* align declare and init order
2024-07-12 09:49:32 +01:00
Michael Sokolov 8d1e624a67
Add HnswGraphBuilder.getCompletedGraph() and record completed state (#13561) 2024-07-11 11:44:49 -04:00
Chris Hostetter cc854f408f WordBreakSpellChecker.suggestWordBreaks now does a breadth first search (#12100) 2024-07-10 11:07:30 -07:00
Jakub Slowinski 49e781084a
Minor cleanup in some Facet tests (#13489) 2024-07-10 17:05:09 +01:00
Benjamin Trent 428fdb5291
Reduce heap usage for knn index writers (#13538)
* Reduce heap usage for knn index writers

* iter

* fixing heap usage & adding changes

* javadocs
2024-07-10 10:28:48 -04:00
Adrien Grand 026d661e5f
Use `IndexInput#prefetch` for terms dictionary lookups. (#13359)
This introduces `TermsEnum#prepareSeekExact`, which essentially calls
`IndexInput#prefetch` at the right offset for the given term. Then it takes
advantage of the fact that `BooleanQuery` already calls `Weight#scorerSupplier`
on all clauses, before later calling `ScorerSupplier#get` on all clauses. So
`TermQuery` now calls `TermsEnum#prepareSeekExact` on `Weight#scorerSupplier`
(if scores are not needed), which in-turn means that the I/O all terms
dictionary lookups get parallelized across all term queries of a
`BooleanQuery` on a given segment (intra-segment parallelism).
2024-07-10 15:36:35 +02:00
Chris Hegarty da41215a67
Use a confined Arena for IOContext.READONCE (#13535)
Use a confined Arena for IOContext.READONCE.

This change will require inputs opened with READONCE to be consumed and closed on the creating thread. Further testing and assertions can be added as a follow up.
2024-07-10 09:39:35 +01:00
zhouhui ef215d87ab
Lookup next when current doc is deleted in PerThreadPKLookup.lookup (#13556) 2024-07-10 10:14:14 +02:00
Benjamin Trent 9bfde5514c
Fix quantized vector writer ram estimates (#13553)
* Fix quantized vector writer ram estimates

* add test & changes
2024-07-09 13:00:10 -04:00
Jakub Slowinski 295c5d3576
GITHUB#13175: Stop double-checking priority queue inserts in some FacetCount classes (#13488)
* GITHUB#13175: Stop double-checking priority queue inserts

Removing 2 cases of bottomX optimizations where insertWithOverflow already handles the check.

Closes #13175

* Update CHANGES.txt

---------

Co-authored-by: Jakub Slowinski <jslowins@amazon.com>
2024-07-09 10:25:02 -04:00
Ignacio Vera 392ddc154f
Introduce TestLucene90DocValuesFormatVariableSkipInterval for testing docvalues skipper index (#13550)
this commit makes possible to configure dynamically the interval size for doc values skipperfor testing, and add a new 
test suite that changes the interval size randomly.
2024-07-09 15:46:15 +02:00
ChrisHegarty 4baaedaa67 Add link to OpenJDK JIRA issue for VectorUtil::xorBitCount 2024-07-09 12:17:21 +01:00
Patrick Zhai ceb4539609
Refactor and javadoc update for KNN vector writer classes (#13548) 2024-07-08 13:04:27 -07:00
Chris Hegarty 3304b60c9c
Improve VectorUtil::xorBitCount perf on ARM (#13545)
This commit improves the performance of VectorUtil::xorBitCount on ARM by ~4x.

This change is effectively a workaround for the lack of vectorization of Long::bitCount on ARM.

On x64 there is no issue, the long variant of xorBitCount outperforms the int variant by ~15%.
2024-07-08 17:30:45 +01:00
Armin Braun 9e04cb9c41
Override single byte writes to OutputStreamIndexOutput to remove locking (#13543)
Single byte writes to BufferedOutputStream show up pretty hot in
indexing benchmarks. We can save the locking overhead introduced by
JEP374 by overriding and providing a no-lock fastpath.
2024-07-08 10:59:50 +02:00
Armin Braun 675772546c
Optimize MaxScoreBulkScorer (#13544)
Don't use Comparator.comparingDouble(...) in a hotish loop here, it
causes allocations that escape analysis is not able to remove.
=> lets just manually inline this to get predictable behavior and save
up to 0.5% of all allocations in some benchmark runs.
2024-07-08 10:53:26 +02:00
Armin Braun 2a8d328ab2
Replace AtomicLong with LongAdder in HitsThresholdChecker (#13546)
The value for the global count is incremented a lot more than it is
read, the space overhead of LongAdder seems irrelevant => lets use
LongAdder. The performance gain from using it is the higher the more
threads you use, but at 4 threads already very visible in benchmarks.
2024-07-08 10:52:28 +02:00
Armin Braun 62e08f5f4b
TaskExecutor should not fork unnecessarily (#13472)
When an executor is provided to the IndexSearcher constructor, the searcher now executes tasks on the thread that invoked a search as well as its configured executor. Users should reduce the executor's thread-count by
1 to retain the previous level of parallelism. Moreover, it is now possible to start searches from the same executor that is configured in the IndexSearcher without risk of deadlocking. A separate executor for starting searches is no longer required.

Previously, a separate executor was required to prevent deadlock, and all the tasks were offloaded to it unconditionally, wasting resources in some scenarios due to unnecessary forking, and the caller thread having to wait for all tasks to be completed anyways. it can now actively contribute to the execution as well.
2024-07-04 11:15:26 +02:00
Christine Poerschke f4cd4b46fc
Lucene99HnswVectorsReader.search float-vs-byte variants: reduce code duplication (#13529)
* Lucene99HnswVectorsReader.search float-vs-byte variants: reduce code duplication

* action review feedback: use org.apache.lucene.util.IOSupplier
2024-07-01 17:32:04 +01:00
Christine Poerschke 0ad270d8b0
[Abstract]Knn[Byte|Float]VectorQuery tweaks: reduce duplicate method calls (#13528)
* reduce LeafReaderContext.reader()[.maxDoc()] calls in AbstractKnnVectorQuery.getLeafResults

* reduce IndexReader.leaves() calls in AbstractKnnVectorQuery.findSegmentStarts

* reduce LeafReaderContext.reader() calls in Knn(Byte|Float)VectorQuery.approximateSearch
2024-07-01 17:31:02 +01:00
zhouhui 3cd406e783
Remove unused segNo calculation in IndexWriter.doFlush (#13491) 2024-07-01 17:29:10 +01:00
Stefan Vodita 5f91d609ea
Make Gradle dashboard easy to find by adding a badge (#13476) 2024-07-01 09:09:51 +01:00
Benjamin Trent 19fe1a56f7
Fix more vector similarity query tests (#13530) 2024-06-29 13:54:32 -04:00
Adrien Grand 44ad4d95c6
Add bw tests for block-tree with inlined metadata. (#13527)
The backport of #13524 found a hole in the testing of `Lucene40BlockTreeTerms`
for versions before we moved metadata to its own file. This PR adds explicit bw
testing for this version. Adding the correct if/else statements made the code
extremely complicated so I opted for restoring the file as it was at the time
when we bumped the version.

This also fixes the bug that we introduced in #13524.
2024-06-28 21:29:00 +02:00
Ignacio Vera f8ee339f64 Add back-compat indices for 9.11.1 2024-06-27 16:23:03 +02:00
Ignacio Vera 2aec233b5c Sync CHANGES for 9.11.1 2024-06-27 16:14:36 +02:00
Ignacio Vera d47a5afc65 spotless 2024-06-27 16:08:48 +02:00
Ignacio Vera 803a743cd7 Add bugfix version 9.11.1 2024-06-27 16:02:56 +02:00
Ignacio Vera b737c5f707 DOAP changes for release 9.11.1 2024-06-27 15:40:55 +02:00
Armin Braun 126834c09e
Reduce overhead for FSTs in FieldReader (#13524)
We don't need to clone the index input we hold on to in OffHeapFSTStore
since we only use it for slicing from known coordinates anyway.
-> remove the cloning and add the infrastructure to initialize
OffHeapFSTStore without seeking the input to the starting offset.
2024-06-27 09:52:10 +02:00
Armin Braun 33a4c1d8ef
Reduce memory use of MinimizationOperations#minimize (#13511)
It is relatively easy to consume a massive amount of memory
for the minimize operation, with its lists of boxed Integer (even though these are mostly cached,
it's still more than 4b per instance to store them instead of plain storage) and neverending
duplicate+empty StateList instances.
The boxed integer situation we can fix and probably speedup by using the hppc primitive collections.
To fix the duplicate/empty StateList instances, we can use a constant. This requires some hacky forking
on the write path but that's about it.
This is partly motivated by ES users at times creating broken, very long prefix queries that can then eat up
GBs of heap. With this change, the examples I've been looking at become about 6x cheaper heap wise, making it
less likely that kind of mistakes impacts stability.
2024-06-25 16:15:30 +02:00
zhouhui 3ae59a9809
Fix Method declared 'final' in 'final' class. (#13492) 2024-06-21 13:47:55 -04:00
Adrien Grand cfbf8d93df
Honor read advice on compound files. (#13467)
This includes the following changes:
 - New `IndexInput#slice(String, long, long, ReadAdvice)` API that allows creating slices with different advices.
 - `PosixNativeAccess` now explicitly sets `MADV_NORMAL` when called with `ReadAdvice.NORMAL`. This is required to be able to override a `RANDOM` advice of a compound file with a `NORMAL` advice of a sub file of this compound file.
 - `PosixNativeAccess` now only ignores the first page if a range of bytes starts before the `MemorySegment` instead of the whole range.
2024-06-21 14:39:41 +02:00
Zack Kendall 06c4a4b9e0
Prevent DefaultPassageFormatter from taking shorter overlapping passages (#13384) 2024-06-21 10:57:59 +01:00
yadda yadda yadda c7f4b8dee2
Fix NPE in StringValueFacetCounts over empty match-set (#13494) 2024-06-21 10:18:39 +01:00
Dawid Weiss ab291210db Removed changes entry for #13315 entirely as it'll appear in 9.11.1 section, once released. 2024-06-20 16:49:55 +02:00
Dawid Weiss 2529075d48 Moved changes entry to 9.12 (with the possibility of backporting to 9.11.1) #13315 2024-06-20 16:41:11 +02:00
Stéphane Campinas d453832bb8
Fix IndexOutOfBoundsException thrown in DefaultPassageFormatter by unordered matches (#13315) 2024-06-20 16:36:51 +02:00
zhouhui 057cbf3c86
Use getAndSet, getAndClear instead split operations. (#13507) 2024-06-19 11:53:12 +02:00
Greg Miller 937c004eda
Fix global score update bug in MultiLeafKnnCollector (#13463) 2024-06-18 18:34:15 -07:00
Dawid Weiss 7e31f56ea1 Add versions.toml to .gitattributes and normalize line endings to lf. #13484 2024-06-18 14:25:40 +02:00
Dawid Weiss ff3fe75adb Add build-tools to smoke tester's expect list. #13484 2024-06-18 10:33:53 +02:00
Dawid Weiss bff0b1daee Smoke tester should no longer expect versions.props and look for versions.toml instead. #13484 2024-06-18 10:17:38 +02:00
Dawid Weiss 04def26289 Smoke tester should no longer expect buildSrc at the top level. #13484 2024-06-18 09:57:19 +02:00
Dawid Weiss 676be86e8f Correct the default checksum for artifacts to be sha512. #13484 2024-06-18 09:43:29 +02:00
Michael Sokolov 27a3e71fa3 CHANGES entry for FlatVectorsFormat 2024-06-17 11:19:06 -04:00
Ignacio Vera d29c57e50c
Fix backward codec test after introducing the doc values skip index (#13487)
The introduction of the doc values skip index in #13449 broke the backward codec test as those codecs do not support
 it. This commit fix it by breaking up the base class for the tests.
2024-06-17 09:58:12 +02:00