Commit Graph

37384 Commits

Author SHA1 Message Date
Pulkit Gupta 1c655823dd
Mark COSINE VectorSimilarity function as deprecated (#13473) 2024-06-11 13:49:21 -04:00
Benjamin Trent cfdc747cde
Adjust assertion check to not throw an NPE (#13479) 2024-06-11 09:48:21 -04:00
Bruno Roustant 51e60f49f8 Add missing entry in changes.txt (#13431) 2024-06-11 14:10:09 +02:00
Bruno Roustant 4e8fb2a9df
Optimize Japanese UserDictionary. (#13431)
Replace TreeMap by a List of Match. Use compiled Pattern.
2024-06-11 10:02:58 +02:00
Michael Sokolov edba83e636 equivocate about IntelliJ test runner 2024-06-10 08:40:38 -04:00
Dawid Weiss 06f86a5096
Silence odd test runner warnings after gradle upgrade (#13471) 2024-06-10 11:31:40 +02:00
Stefan Vodita fb94403e0f Fix typo in SimpleSortedSetFacetsExample.java 2024-06-10 08:44:47 +00:00
Paul King 5e0f549185
Fix typo in StringValueFacetCountsExample.java (#13474) 2024-06-10 09:25:27 +01:00
Hank Chang 18d48d422d
Add new test case "testGetLines" for lucene/core/analysis/WordlistLoader (#13419) 2024-06-10 09:07:26 +01:00
Michael Sokolov 0699117cc5 clarify that IntelliJ UI varies across platforms 2024-06-07 10:13:16 -04:00
Michael Sokolov 71a9aed45d fix fumble-finger 2024-06-07 10:13:16 -04:00
Michael Sokolov 262341b753 on README.md, make links to CONTRIBUTING.md more prominent, and demote link to dev-docs 2024-06-07 10:13:16 -04:00
Benjamin Trent 2d62faa4bb
Add int8_hnsw backcompat index creawtion to dev tools scripts (#13465) 2024-06-07 09:24:20 -04:00
Michael Sokolov a5b4b8c8b0
Document how to make tests run faster in IntelliJ (#13466)
also make links to CONTRIBUTING.md more prominent, and demote link to dev-docs
2024-06-07 08:47:16 -04:00
Armin Braun c7a7d48d65
Reduce the heap use of BKDReader instances (#13464)
We consume a lot of memory for the `indexIn` slices. If `indexIn` is of
type `MemorySegmentIndexInput` the overhead of keeping loads of slices
around just for cloning is far higher than the extra 12b per reader this
adds (the slice description alone often costs a lot).
In a number of Elasticsearch example uses with high segment counts I
investigated, this change would save up to O(GB) of heap.
2024-06-07 13:27:10 +02:00
Ignacio Vera 9f8e886702 Move entry in CHANGES.txt 2024-06-07 07:29:15 +02:00
Mayya Sharipova 512ff4ac92
MultiTermQuery return null for ScoreSupplier (#13454)
MultiTermQuery return null for ScoreSupplier if there are no terms in an index that
 match query terms.

With the introduction of PR #12156 we saw degradation in performance of bool queries
where one of the mandatory clauses is a TermInSetQuery with query terms not present in
the field. Before for such cases TermsInSetQuery returned null for ScoreSupplier which
would shortcut the whole bool query.

This PR adds ability for MultiTermQuery to return null for ScoreSupplier if a field
doesn't contain any query terms.

Relates to PR #12156
2024-06-06 14:43:59 -04:00
Benjamin Trent 39a7eabb6d Add back-compat indices for 9.11.0 2024-06-06 13:53:37 -04:00
Benjamin Trent 51d8d7263d Sync CHANGES for 9.11.0 2024-06-06 12:56:10 -04:00
Ignacio Vera 58ab5b7826
Merge related HashMaps in FieldInfos#FieldNumbers into one map (#13460)
Merges all immutable attributes in FieldInfos.FieldNumbers into one hashmap saving memory when 
writing big indices. Fixes an exotic bug when calling clear where not all attributes were cleared.
2024-06-06 17:08:05 +02:00
Benjamin Trent 61a6abd857 DOAP changes for release 9.11.0 2024-06-06 10:23:04 -04:00
Sanjay Dutt d0d2aa274f
Removed Scorer#getWeight (#13440)
If Caller requires Weight then they have to keep track of Weight with which Scorer was created in the first place instead of relying on Scorer.

Closes #13410
2024-06-06 16:03:19 +02:00
Adrien Grand d5aa88bd7e
Add test for ghost fields to BaseKnnVectorQueryTestCase. (#13455) 2024-06-06 16:00:55 +02:00
Dawid Weiss b85c99daaf Java 22 has been released, so drop -ea from smoketester gh workflow matrix. 2024-06-06 15:45:27 +02:00
Dawid Weiss 14782a2a09
Add a github workflow that checks common (and less common) gradle tasks when gradle version is changed (#13456) 2024-06-06 15:35:55 +02:00
Dawid Weiss 868897e43e Update WrapperDownloader to accept java 22 and correct deprecated new URL API #13458 2024-06-06 11:51:00 +02:00
Chris Hegarty 9a4caa935a
Update Gradle wrapper to 8.8 - supports Java 22 (#13453)
This commit updates the Gradle wrapper to 8.8, which has support for Java 22.
2024-06-06 08:46:18 +01:00
panguixin fe50e86e36
Implement Weight#count for vector values in the FieldExistsQuery (#13322)
* implement Weight#count for vector values

* add change log

* apply review comment

* apply review comment

* changelog

* remove null check
2024-06-05 15:02:51 -04:00
Adrien Grand 05b4639c0c
Add prefetching for doc values and norms. (#13411)
This follows a similar approach as postings and only prefetches the first page
of data.

I verified that it works well for collectors such as `TopFieldCollector`, as
`IndexSearcher` first pulls a `LeafCollector`, then a `BulkScorer` and only
then starts feeding the `BulkScorer` into the `LeafCollector`. So the
background I/O for the `LeafCollector` which will prefetch the first page of
doc values and the background I/O for the `BulkScorer` will run in parallel.
2024-06-05 13:43:14 +02:00
Adrien Grand 846aa2f8c3
Use `ReadAdvice#NORMAL` on files that have a forward-only access pattern. (#13450)
This applies to files where performing readahead could help:
 - Doc values data (`.dvd`)
 - Norms data (`.nvd`)
 - Docs and freqs in postings lists (`.doc`)
 - Points data (`.kdd`)

Other files (KNN vectors, stored fields, term vectors) keep using a `RANDOM`
advice.
2024-06-05 13:41:58 +02:00
Ioana Tagirta e868b82045
Rewrite newSlowRangeQuery to MatchNoDocsQuery when upper > lower (#13425) 2024-06-04 18:38:50 +02:00
Zhang Chao 801b822972
Avoid unnecessary memory allocation in PackedLongValues#Iterator (#13439)
We always allocate a long array of page size for a new PackedLongValues#Iterator instance, which is not necessary when packing a small number of values. this is more evident in the scenario of high-frequency flush operations
2024-06-04 13:03:09 +08:00
Michael Sokolov c132e95369
mention KnnVectorsFormat in o.a.l.codecs package javadocs (#13448)
Co-authored-by: Michael Sokolov <sokolovm@amazon.com>
2024-06-03 11:27:41 -04:00
Adrien Grand edd7747370
Add prefetching support to stored fields. (#13424)
This adds `StoredFields#prefetch(int)`, which mostly delegates to
`IndexInput#prefetch`. Callers can take advantage of this API to parallelize
I/O across multiple stored documents by first calling `StoredFields#prefetch`
on all doc IDs before calling `StoredFields#document` on all doc IDs.

I added a cache of recently prefetched blocks to the default codec, in order to
avoid prefetching the same block multiple times in a short period of time. This
felt sensible given that doc ID reordering via recursive graph bisection or
index sorting are likely to result in search results being clustered.
2024-06-03 09:25:23 +02:00
Zhang Chao a6f920d989
Fix test failure on TestPoint#testEqualsAndHashCode (#13433) 2024-06-03 10:43:01 +08:00
Benjamin Trent a540027bde
Add new dynamic confidence interval configuration to scalar quantized format (#13445)
When int4 scalar quantization was merged, it added a new way to dynamically calculate quantiles.

However, when that was merged, I inadvertently changed the default behavior, where a null confidenceInterval would actually calculate the dynamic quantiles instead of doing the previous auto-setting to 1 - 1/(dim + 1).

This commit formalizes the dynamic quantile calculate through setting the confidenceInterval to 0, and preserves the previous behavior for null confidenceIntervals so that users upgrading will not see different quantiles than they would expect.
2024-06-01 13:25:38 -04:00
Chris Hegarty f3c2b91630
SimpleText[Float|Byte]VectorValues::scorer should return null when the vector values is empty (#13444)
This commit ensures that SimpleText[Float|Byte]VectorValues::scorer returns null when the vector values is empty, as per the scorer javadoc. Other KnnVectorsReader implementations have specialised empty implementations that do similar, e.g. OffHeapFloatVectorValues.EmptyOffHeapVectorValues. The VectorScorer interface in new in Lucene 9.11, see #13181

An existing test randomly hits this, but a new test has been added that exercises this code path consistently. It's also useful to verify other KnnVectorsReader implementations.
2024-05-31 14:27:25 +01:00
Adrien Grand 750a7c4d3b
Fix TestIndexWriterOnError.testIOError failure. (#13436)
Pull request #13406 inadvertly broke Lucene's handling of tragic exceptions by
stopping after the first `DocValuesProducer` whose `close()` calls throws an
exception, instead of keeping calling `close()` on further producers in the
list.

This moves back to the previous behavior.

Closes #13434
2024-05-29 22:08:10 +02:00
Benjamin Trent 9a3dbd5dd7 Add next minor version 9.12.0 2024-05-29 14:46:31 -04:00
Stefan Vodita b3dc9153bb
Allow users to retrieve counts from taxo association facets (#13414)
Add a count field to LabelAndValue
2024-05-29 07:55:37 +01:00
Amir Raza ea0646d094
Fixes failing test case for TestOrdinalMap.testRamBytesUsed (#13421) 2024-05-28 18:53:08 +02:00
Peter Gromov 54d3ff64bc
hunspell: speed up "compress"; minimize the number of the generated entries; don't even consider "forbidden" entries anymore (#13429)
Hunspell: speed up "compress"; minimize the number of the generated entries; don't even consider "forbidden" entries anymore
2024-05-28 18:09:40 +02:00
Uwe Schindler 4438404457 Remove useless SPI "uses" clause after previous commit 2024-05-28 00:21:13 +02:00
Uwe Schindler b1189adeb3
Remove incorrect/expensive use of ServiceLoader for choosing random format (#13428) 2024-05-27 23:59:28 +02:00
Ben Chaplin c06fff6a52
Add test for parsing brackets in range queries (#13323) 2024-05-27 20:34:05 +02:00
Navneet Verma 6efce2189e
Add support for reloading the SPI for KnnVectorsFormat class (#13394)
Signed-off-by: Navneet Verma <navneev@amazon.com>
2024-05-27 18:56:05 +02:00
Chris Hegarty 80304802a5
Fix duplicate values in org.apache.lucene.analysis.ko.dict.UserDictionary (#13427)
Remove incorrect assertion in org.apache.lucene.analysis.ko.dict.UserDictionary, and replace with array copy if duplicate values are passed.
2024-05-27 17:53:01 +01:00
Chris Hegarty 944624b644
MemorySegment scorer should ensure that the values is of the correct type (#13423)
This commit updates the MemorySegment scorer so that it ensures the values is of the correct type.

The offset calculations for vectors in RandomAccessQuantizedByteVectorValues will be different than that of non-quantized. We can generalise the implementation for quantized vectors later, but for now, passing a quantised values indicated bug in wrapping or delegation.
2024-05-27 17:19:16 +01:00
Bruno Roustant f394c9418e
Remove the HPPC dependency from all modules and move the HPPC fork to internal. (#13422)
* Remove hppc dependency
* Change fork version to 0.10.0
* Add @lucene.internal
* Move hppc classes to oal.internal.hppc but export it.
* Delete hppc license since it's no longer a dependency.

---------

Co-authored-by: Dawid Weiss <dawid.weiss@carrotsearch.com>
2024-05-27 12:09:25 +02:00
Adrien Grand ddf538d43e
Move bulkScorer() from Weight to ScorerSupplier (#13408)
This relates to #13359: we want to take advantage of the `Weight#scorerSupplier` call to start scheduling some I/O in the background in parallel across clauses. For this to work properly with top-level disjunctions, we need to move `#bulkScorer()` from `Weight` to `ScorerSupplier` as well, so that the disjunctive `BooleanQuery` first performs a call to `Weight#scorerSupplier()` on all inner clauses, and then `ScorerSupplier#bulkScorer` on all inner clauses.

`ScorerSupplier#get` and `ScorerSupplier#bulkScorer` only support being called once. This forced me to fix some inefficiencies in `bulkScorer()` implementations when we would pull scorers and then throw it away when realizing that the strategy we were planning on using was not optimal. This is why e.g. `ReqExclBulkScorer` now also supports prohibited clauses that produce a two-phase iterator.
2024-05-27 09:56:26 +02:00