Commit Graph

37617 Commits

Author SHA1 Message Date
ChrisHegarty 22ac47c07a Fix bwc tests by adding next minor version - even though there will never be a 9.13.0 2024-09-29 20:27:06 +01:00
zhouhui 7eea8fbd0d
Fix comment on compare suffix and target. (#13787) 2024-09-29 11:12:32 -04:00
Michael Sokolov 0a8604d908 Merge remote-tracking branch 'origin/main' into main 2024-09-28 17:45:05 -04:00
Michael Sokolov c8eeacb39a fix safety check in KnnVectorsWriter 2024-09-28 17:44:33 -04:00
Michael Sokolov f21ec8414c SlowCompositeCodecReaderWrapper KnnVectorValues handles binary search over array with repeated values 2024-09-28 17:43:01 -04:00
ChrisHegarty a38443bc6a Add back-compat indices for 9.12.0 2024-09-28 21:47:03 +01:00
ChrisHegarty dafe006652 DOAP changes for release 9.12.0 2024-09-28 21:14:49 +01:00
Michael Sokolov 6053e1e313
First-class random access API for KnnVectorValues (#13779) 2024-09-28 09:14:01 -04:00
ChrisHegarty 7b4b0238d7 Fix back compat 11.8.4 indices in main 2024-09-26 14:54:17 +01:00
ChrisHegarty ff57fa7b42 Add RDF entries for 8.11.4 2024-09-25 16:35:24 +01:00
Chris Hegarty 64371c14d6
Add 8.11.4 backward compat indices (#13824)
This commit add 8.11.4 back compat indices.
2024-09-25 16:20:54 +01:00
ChrisHegarty 53d1c2bd2f Test fix: make float vector dims even for SQ testing 2024-09-20 15:28:54 +01:00
Adrien Grand 73d71acedd Also fix formats that are only tested nightly. 2024-09-20 15:24:04 +02:00
Adrien Grand da1f954601
Improve testing of mismatched field numbers. (#13812)
This improves testing of mismatched field numbers by
 - improving `AssertingDocValuesProducer` to detect mismatched field numbers,
 - introducing a `MismatchedCodecReader` to actually test mismatched field
   numbers on `DocValuesProducer` (a `MismatchedLeafReader` wrapping a
`SlowCodecReaderWrapper` doesn't work since `SlowCodecReaderWrapper` implicitly
resolves the correct `FieldInfo` object),
 - introducing an explicit test for mismatched field numbers for doc values, points,
postings and knn vectors.

These new tests uncovered a bug when merging sorted doc values, which would
call the underlying doc values producer with the merged field info.

Closes #13805
2024-09-20 14:37:45 +02:00
Chris Hegarty 7ef7122eba
Revert "Replace Map<String,Object> with IntObjectHashMap for DV producer (#13686) (#13810)
Reverts "Replace Map<String,Object> with IntObjectHashMap for DV producer (#13686)

relates #13809
2024-09-20 11:06:43 +01:00
Christoph Büscher e4ac57746e
Add BytesRefIterator to TermInSetQuery (#13806)
TermInSetQuery used to have an accessor to its terms that was removed in #12173
to protect leaking internal encoding details. This introduces an accessor to the
term data in the query that doesn't expose internals but merely allows iterating
over the decoded BytesRef, making inspection of the querys content possible again.

Closes #13804
2024-09-19 11:51:42 +02:00
Benjamin Trent 6d987e1ce1
Disable intra-merge parallelism for all structures but kNN vectors (#13799)
After adjusting tests that truly exercise intra-merge parallelism, more issues have arisen. See: https://github.com/apache/lucene/issues/13798

To be risk adverse & due to the soon to be released/freezed Lucene 10 & 9.12, I am reverting all intra-merge parallelism, except for the parallelism when merging HNSW graphs.

Merging other structures was never really enabled in a release (we disabled it in a bugfix for Lucene 9.11). While this is frustrating as it seems like we leaving lots of perf on the floor, I am err'ing on the side of safety here. 

In Lucene 10, we can work on incrementally reenabling intra-merge parallelism.

closes: https://github.com/apache/lucene/issues/13798
2024-09-18 08:36:11 -04:00
Alan Woodward dbceba77a4
Correct Point file extensions in Codec javadocs (#13801) 2024-09-18 12:33:31 +01:00
Adrien Grand b59a357e58
Change docValuesSkipIndex from a boolean to an enum. (#13784)
At the moment, our skip indexes record min/max ordinal/value per range
of doc IDs. It would be natural to extend it to other pre-aggregated
data such as a sum and value count, which facets could take advantage
of. This change switches `docValuesSkipIndex` from a boolean to an enum
so that we could release such changes in the future in an additive
fashion, by adding constants to this enum and new methods to
`DocValuesSkipper`.
2024-09-17 14:35:30 +02:00
Armin Braun 644feeb02a
Cleanup redundant allocations and code around Comparator use (#13795)
Noticed some visible allocations in CompetitiveImpactAccumulator
during benchmarking and fixed the needless allocation for the comparator
in that class as well as a couple other similar spots where needless
classes and/or objects could easily be replaced by more lightweight
solutions.
2024-09-17 14:34:31 +02:00
Christine Poerschke a817426511
add RawTFSimilarity class (#13749) 2024-09-17 13:11:25 +01:00
Luca Cavanna a4c79c8d30
Remove CollectorManager#forSequentialExecution (#13790)
We have recently (see #13735) introduced this utility method that creates a
collector manager which only works when a searcher does not have an executor
set, otherwise it throws exception once we attempt to create a new collector
for more than one slice.

While we discussed it should be safe to use in some specific scenarios like the
monitor module, we should be careful exposing this utility publicly, because
while we'd like to ease migration from the search(Query, Collector) method, we
may end up making users like even worse, in that it exposes them to failures
whenever an executor is set and there are more than one slice created, which
is hard to follow and does not provide a good user experience.

My proposal is that we use a similar collector manager locally, where safe and
required, but we don't expose it to users. In most places, we should rather
expose collector managers that do support search concurrency, rather than working
around the lack of those.
2024-09-17 09:41:10 +02:00
Adrien Grand f4ebed2404
Make Automata#optional create simpler automata. (#13793)
In the common case when the input automaton has no transition to state 0, the
optional automaton can be created by marking state 0 as accepted.
2024-09-16 15:19:28 +02:00
Mike Pellegrini e7a6382089
Fix Flaky Test In TestBlockJoinBulkScorer (#13785) 2024-09-16 14:50:51 +02:00
Adrien Grand 73173a40c1 Revert "Speed up advancing within a block. (#13692)"
This reverts commit 79fd9fee97.
2024-09-16 10:39:21 +02:00
Dawid Weiss ebeb5c3281 Add --stacktrace to gradlew invocations for debugging odd issues #13792 2024-09-16 08:32:05 +02:00
Mike McCandless 3801d85978 #13767: fix test failure: compress can only be true when quantized bits=4 2024-09-15 16:11:00 -04:00
Mike McCandless a7332fb30a GITHUB#13519: move CHANGES entry to 9.12.0 2024-09-15 15:46:16 -04:00
Michael McCandless a1418d9433
Remove 8 bit quantization for HNSW/KNN vector indexing (it is buggy today) (#13767)
4 and 7 bit quantization still work.

It's a bit tricky because 9.11 indices may have 8 bit compressed
vectors which are buggy at search time (and users may not realize it,
or may not be using them at search time).  But the index is still
intact since we keep the original full float precision vectors.  So,
users can force rewrite all their 9.11 written segments (or reindex
those docs), and can change to 4 or 7 bit quantization for newly
indexed documents.  The 9.11 index is still usable.

(I added a couple test cases confirming that one can indeed change
their mind, indexing a given vector field first with 4 bit
quantization, then later (new IndexWriter / Codec) with 7 bit or with
no quantization.)

I added MIGRATE.md explanation.

Separately, I also tightned up the `compress` boolean to throw an
exception unless bits=4.  Previously (for 7 bit compression) it
silently ignored `compress=true` for 7, 8 bit quantization.  And tried
to improve its javadocs a bit.

Closes #13519.
2024-09-15 15:26:28 -04:00
Shubham Chaudhary 111ccf6c30
Fix TestShapeDocValues.testLatLonPolygonBBox (#13743) 2024-09-15 13:20:50 -04:00
mrhbj 568d1f3fbe
Reduce number of calculations in FSTCompiler (#13788)
* Simplify FST return

* Reduce number of calculations in FSTCompiler
2024-09-14 10:51:12 -04:00
Stefan Vodita aa86a8119a
Add unit-of-least-precision float comparison (#13723) 2024-09-14 09:51:10 +01:00
Christine Poerschke 7c056ab88c
similarities: provide default computeNorm implementation; remove remaining discountOverlaps setters; (#13757)
Co-authored-by: Robert Muir <rmuir@apache.org>
2024-09-13 09:27:35 +01:00
Luca Cavanna f778cc4924
Remove IndexSearcher#search(List<LeafReaderContext>, Weight, Collector) (#13780)
With the introduction of intra-segment concurrency, we have introduced a new
protected search(LeafReaderContextPartition[], Weight, Collector) method. The
previous variant that accepts a list of leaf reader contexts was left deprecated
as there is one leftover usages coming from search(Query, Collector). The hope was
that the latter was going to be removed soon as well, but there is actually no
need to tie the two removals. It is easier to fold this method into its only
caller, in order for it to still bypass the collector manager based methods. 
This way we fold two deprecated methods into a single one.
2024-09-13 09:00:50 +02:00
Luca Cavanna fe64b04fda
Replace docBase with actual docId in MaxScoreAccumulator (#13777)
We have been encoding docBase and the score in MaxScoreAccumulator#accumulate.
That makes the assumption that segments are going to be processed in doc order
and implements global max score accounting across segments searched concurrently.

With the introduction of intra-segment concurrency, the same segment may be seen
multiple times, once per segment partition. Partitions are all going to have the same
docBase, hence you may end up with topN results with higher docIds than expected,
because the search early terminates before docs with same score and lower doc ids
are seen.

This commit encodes the docId in the accumulator in place of the docBase to resolve
the described issue.
2024-09-13 08:58:10 +02:00
Adrien Grand 5045d3c67b Fix compile error. 2024-09-13 07:54:48 +02:00
Adrien Grand e8e179cd45
Add prefetching support to term vectors. (#13758)
This follows the same approach that we used for stored fields.
2024-09-13 07:45:12 +02:00
Chris Hegarty 3a8f75ccfc
Make HnswLock and LockedRow final (#13776)
Trivial commit that makes HnswLock final and LockedRow a record. This is general clean up and helps the JIT a little when reasoning about these types - which show quite a bit in indexing and search profiles.
2024-09-12 20:39:57 +01:00
Adrien Grand 2f7da75b7d
Migrate more classes to records. (#13772) 2024-09-12 21:38:28 +02:00
Luca Cavanna cb48c7121a
Lower number of hits in TestLargeNumHitsTopDocsCollector (#13775)
There's two tests where we use 250_000 as number of collected hits, but we only
ever index max 2000 docs. That makes use create a priority queue of size
250_000 for each segment partition which causes out of memory errors when the
number of partitions is higher than a few.

With this commit I propose that we lower the threshold to 2000 for those tests
that need a high number of collected hits. The assumption that a priority queue
is not built within the LargeNumHitsTopDocsCollector still holds so this change
should not defeat the purpose of the tests.
2024-09-12 16:19:22 +02:00
Luca Cavanna 5359d36ba6
Introduce ProfilerCollectorManager (#13746)
ProfilerCollector did not have until now a corresponding collector manager.
This commit introduces one and switches TestProfilerCollector to use search
concurrency and move away from the deprecated search(Query, Collector) method.

Note that the collector manager does not support children collectors. Figuring
out a generic API for that is rather complicated. Users can always create
their own collector manager depending on their collector hierarchy.

Relates to #12892
2024-09-12 15:30:22 +02:00
mrhbj 91c6954e24
Simplify FST return (#13771) 2024-09-12 15:20:10 +02:00
Adrien Grand ff8b81afc5
Integrate merge-time index reordering with the intra-merge executor. (#13289)
Index reordering can benefit greatly from parallelism, so it should try to use
the intra-merge executor when possible.
2024-09-12 14:43:26 +02:00
Luca Cavanna aa86c2b8a0
Address length used to copy array in FacetsCollector to not be out of bounds (#13774)
This has caused a few recent test failures with jdk23 and jdk24. It should
get fixed replacing the length with the lengt of the array, rather than using
the new length.
2024-09-12 13:08:44 +02:00
Christine Poerschke ef577ea43a
PayloadScoreQuery javadoc update w.r.t. SpanQuery use (#13731) 2024-09-12 11:23:22 +01:00
Benjamin Trent 74e3c44063
Unify how missing field entries are handle in knn formats (#13641)
During segment merge we must verify that a given field has vectors and exists. The typical knn format checks assume the per-field format is used and thus only check for `null`. 

But we should check for field existence in the field info and verify it has dense vectors

Additionally, this commit unifies how the knn formats work and they will throw if a non-existing field is queried. Except for PerField format, which will return null (like the other per field formats)
2024-09-11 16:46:38 -04:00
Shubham Chaudhary 8760654faa
Remove unnecessary methods from DocAndScore (#13769) 2024-09-11 22:32:23 +02:00
Adrien Grand f0fd51c4d5
Make TotalHits a record. (#13762) 2024-09-11 15:50:06 +02:00
Greg Miller c26c2d6e09
Remove usage of IndexSearcher#Search(Query, Collector) from monitor package (#13735) 2024-09-11 06:26:14 -07:00
Benjamin Trent b940511b07
This commit adds a new test CMS that always provides intra-merge parallelism (#13475)
@iverase has uncovered a potential issue with intra-merge CMS parallelism.

This commit helps expose this problem by forcing tests to use intra-merge parallelism instead of always (well, usually) delegating to a SameThreadExecutorService.

When intra-merge parallelism is used, norms, doc_values, stored_values, etc. are all merged in a separate thread than the thread that was used to construct their merge optimized instances.

This trips assertions numerous assertions in AssertingCodec.assertThread where we assume that the thread that called getMergeInstance() is also the thread getting the values to merge.

In addition to the better testing, this corrects poor merge state handling in the event of parallelism.
2024-09-11 09:14:50 -04:00