Commit Graph

37163 Commits

Author SHA1 Message Date
Uwe Schindler 6566e33ff1 add changes entry 2024-01-30 11:48:07 +01:00
Dmitry Cherniachenko 13ea880508
Align instanceof check with type cast (#13039) 2024-01-30 11:47:00 +01:00
Dmitry Cherniachenko 39c10a2929
Change `set.removeAll(list)` to `list.forEach(set::remove)` (#13052) 2024-01-30 11:39:15 +01:00
Dmitry Cherniachenko d988f91aba
Use orElseGet() to avoid unnecessary object allocation (#13048) 2024-01-30 00:15:56 +01:00
Dmitry Cherniachenko d69df16bf8
Replace `new HashSet<>(Arrays.asList())` with `EnumSet.of()` (#13051) 2024-01-30 00:14:28 +01:00
Dmitry Cherniachenko cbec94c153
Use String.isEmpty() instead of equals("") (#13050) 2024-01-30 00:14:10 +01:00
Dmitry Cherniachenko 97464ebfcb
Use String.indexOf(char) where possible (#13049) 2024-01-30 00:13:56 +01:00
Dmitry Cherniachenko 0c2802f37a
Use String.replace() instead of replaceAll() (#13047) 2024-01-30 00:13:43 +01:00
Dmitry Cherniachenko e3a6a4bd8f
Remove concatenation in String.format() calls (#13038) 2024-01-30 00:13:31 +01:00
ChrisHegarty 239b83fca5 Add back-compat indices for 9.9.2 2024-01-29 16:55:04 +00:00
ChrisHegarty 4e5b294726 Add bugfix version 9.9.2 2024-01-29 16:30:42 +00:00
ChrisHegarty c40ad6a065 DOAP changes for release 9.9.2 2024-01-29 15:27:35 +00:00
Shintaro Murakami 141413633f
Support getMaxScore of ConjunctionScorer for non top level scoring clause (#13043) 2024-01-29 14:07:09 +01:00
sabi0 21e545501e
Make use of null-checked variable (#13040) 2024-01-29 09:19:07 +01:00
sabi0 fe4631c8d2
Use short-circuit boolean expressions (#13042) 2024-01-29 09:16:40 +01:00
Shintaro Murakami 7832d3c9fe
Propagate topLevelScoringClause from QueryProfiler (#13031) 2024-01-29 09:11:42 +01:00
Adrien Grand 7d35ae4858
Propagate minimum competitive score in ReqOptSumScorer. (#13026)
If the required clause doesn't contribute scores, which typically happens if
the required clause is a `FILTER` clause, then the minimum competitive score
can be propagated directly to the optional clause.
2024-01-26 15:50:22 +01:00
Adrien Grand 082d318abd
Early exit range queries on non-matching segments. (#13033)
This change makes `PointRangeQuery` exit early when it knows that it doesn't
match a segment. In the case when this query is part of a conjunction, this
helps make sure `ScorerSupplier#get` doesn't get called on other required
clauses, which is sometimes an expensive operation (e.g. multi-term queries).

This is especially relevant for time-based data combined with
`LogByteSizePolicy`, which gives non-adjacent ranges of timestamps to each
segment, which in-turn increases the likelihood that some segments won't match
a range query at all.
2024-01-26 15:47:01 +01:00
Benjamin Trent fb5037f841
Do not use mock merge policy for TestGrouping (#13034) 2024-01-26 07:16:27 -05:00
Zhang Chao a9480316e2
Improve Javadoc for Lucene90StoredFieldsFormat (#12984) 2024-01-25 11:11:21 -05:00
ChrisHegarty 20ea551b95 Add 13014 to 9.9.2 changelist 2024-01-25 09:18:05 +00:00
Stefan Vodita 7552c5093f
Fix issues with chunked TaxonomyIndexArray (#13028)
Fix construction from index with multiple of chunk size ordinals.

Fix mutable post-refresh children array.
2024-01-25 07:53:14 +00:00
gf2121 d0098f8489
Rollback the tmp storage of BytesRefHash to -1 after sort (#13014) 2024-01-25 10:48:11 +08:00
Heemin Kim 3a205feb27
Fix bug in ShapeTestUtil (#12287)
boxPolygon and trianglePolygon only uses minX and minY value of give XY Rectangle which results in a polygon with points in single place. With this changes, both methods generate correct polygons.
2024-01-24 18:09:37 +00:00
Benjamin Trent f16007c3ec
Fix NPE when sampling for quantization in Lucene99HnswScalarQuantizedVectorsFormat (#13027)
When merging `Lucene99HnswScalarQuantizedVectorsFormat` a NPE is possible when deleted documents are present.

`ScalarQuantizer#fromVectors` doesn't take deleted documents into account. This means using `FloatVectorValues#size` may actually be larger than the actual size of live documents. Consequently, when iterating for sampling iteration too far is possible and an NPE will be thrown.
2024-01-23 07:54:32 -05:00
Stefan Vodita 3674e779cb
[Minor] Document operation costs for stale workflow (#13000) 2024-01-22 09:40:25 +00:00
Michael Froh 2a0b7f2056
Split taxonomy arrays across chunks (#12995)
Split taxonomy arrays across chunks

Taxonomy ordinals are added in an append-only way.
Instead of reallocating a single big array when loading new taxonomy
ordinals and copying all the values from the previous arrays over
individually, we can keep blocks of ordinals and reuse blocks from the
previous arrays.
2024-01-22 09:11:20 +00:00
Simon Willnauer 24d557a4f6
Run BWC indices generation code together with unittest (#13023)
This change runs the current BWC indices generation code together
with the unittest to catch issues with the generated indices earliy.
Each generation method runs a sanity check on the generated indices.
2024-01-19 15:47:01 +01:00
Simon Willnauer c661c88fc8
Fix BWC test generation after mondernizing LineDocFile (#13021)
The changes on #12929 broke the generation code for BWC indices
since they are expecting vertain fields created by LineDocFile.
Yet, this change adds some sanity checks that run with unittest to ensure
the BWC generation is at least readable with the current version.

Relates to #12929
2024-01-17 15:03:30 +01:00
Simon Willnauer 340d9d2f9c
Prevent parent field from added to existing index (#13016)
This change prevents users from adding a parent field to an existing index.
Parent field must be added before any documents are added to the index to
prevent documents without the parent field from being indexed and later
to be treated as child documents upon merge.

Relates to #12829
2024-01-16 10:53:43 +01:00
gf2121 ed7c78ce6d
LUCENE-10366: Override #readVInt and #readVLong for ByteBufferDataInput to avoid the abstraction confusion of #readByte. (#592) 2024-01-16 17:30:09 +08:00
Sreehari Guruprasad c746bea233
Fixed Field.java documentation to refer to new IntField/FloatField/LongField/DoubleField (#13012)
Co-authored-by: Harshitha-g-06 <harshitha.grs@gmail.com>

Closes #12125
2024-01-15 09:14:02 +01:00
Patrick Zhai d72686be94
Suppress SimpleTextCodec for VectorSimilarityQueryTestCase (#13010) 2024-01-14 20:00:10 -08:00
Adrien Grand e0daca1eb4
Make sure `DocumentsWriterPerThread#getAndLock` never returns `null` on a non-empty queue. (#12959)
Before this change, `DocumentsWriterPerThread#getAndLock` could sometimes
return `null` even though the queue was empty at no point in time. The
practical implication is that we can end up with more DWPTs in memory than
indexing threads, which, while not strictly a bug, may require doing more
merging than we'd like later on.

I ran luceneutil's `IndexGeonames` with this change, and
`DocumentsWriterPerThread#getAndLock` was not the main source of
contention.

Closes #12649 #12916
2024-01-12 16:21:01 +01:00
Michael Froh 7dfef017e3
Output binary doc values as hex array in SimpleTextCodec (#12987)
Binary doc values were being written directly in SimpleTextCodec, though
they may not be valid UTF-8 (i.e. they may not be "text"). This change
encodes them as a string representing an array of hexadecimal bytes.
2024-01-12 16:09:18 +01:00
kuramitsu 8bee41880e
Fix for the bug where JapaneseReadingFormFilter cannot convert some hiragana to romaji (#12885) 2024-01-11 11:33:16 -08:00
Dzung Bui 2a851401a1
Clean up unused code & variables (#12994) 2024-01-11 18:43:25 +01:00
Simon Willnauer df6bd25ce4
Add support for index sorting with document blocks (#12829)
Today index sorting will most likely break document blocks added with `IndexWriter#addDocuments(...)` and `#updateDocuments(...)` since the index sorter has no indication of what documents are part of a block. This change automatically adds a marker field to  parent documents if configured in `IWC`. These marker documents are optional unless document blocks are indexed and index sorting is configured. In this case indexing blocks will fail unless a parent field is configured. Index sorting will preserve document blocks during sort. Documents within a block not be reordered by the sorting algorithm and will sort along side their parent documents. 

Relates to #12711
2024-01-11 16:11:15 +01:00
Michael Froh b7728c5657
Output well-formed UTF-8 bytes in SimpleTextCodec's segmentinfos (#12897)
The SimpleTextSegmentInfoFormat was writing the random byte array used
as a segment's ID directly -- not converting to a simple text
representation of the byte array. As a result, the segment infos were
often malformed.
2024-01-11 15:45:48 +01:00
Zhang Chao 75e1a0b96c
Avoid reset BlockDocsEnum#freqBuffer when indexHasFreq is false (#12997) 2024-01-11 15:37:52 +01:00
zhouhui 4b1180372e
Copy collected acc(maxFreqs) into empty acc, rather than merge them. (#12846) 2024-01-11 14:44:11 +01:00
Dzung Bui 701619d35a
Lazily write the FST padding byte (#12981)
* lazily write the FST padding byte

* Also write the pad byte when there is emptyOutput

* add comment

* Add more comments
2024-01-11 07:31:24 -05:00
sabi0 09837bae73
Cleanup comments and asserts in TestIndexWriter (#13006) 2024-01-10 20:47:03 +01:00
sabi0 f67b1b3d1f
Simplify asserts in TestWordBreakSpellChecker (#13007) 2024-01-10 20:33:40 +01:00
Michael Gibney 89a02fa4e3
Use Automaton for SurroundQuery prefix/pattern matching (#12999) 2024-01-10 13:14:21 -05:00
sabi0 d7a14257ce
Get rid of deprecated assertThat() usages (#12982) 2024-01-10 16:31:29 +01:00
Andrew Ross 872702d828
Remove outdated comment from TaskExecutor (#12993)
A previous iteration of this code used an AtomicInteger and
required this comment. The committed version uses a self-documenting
boolean and the comment is not needed.
2024-01-10 10:35:23 +01:00
Simon Willnauer 4d916a754b Fix test to also take into accont minor versions for BWC 2024-01-09 12:21:13 +01:00
Simon Willnauer ea327220a8
Remove stale BWC tests (#12874)
Both of these tests have been disabled for quiet a long time. While `TestManyPointsInOldIndex`
looks indeed stale, `TestIndexWriterOnOldIndex` is not a more general test.
2024-01-09 11:49:53 +01:00
sabi0 5442748995
Fix missing variable assignment in testAllVersionHaveCfsAndNocfs() and other minor code cleanups (#12969) 2024-01-09 11:04:31 +01:00