Commit Graph

36911 Commits

Author SHA1 Message Date
Chris Hegarty b231e5b213
Reconcile changelog 9.9.0 section (#12867)
Reconcile the changelog between branch_9_9 and main. This change just reorders a number of entries in main to match that of branch_9_9.
2023-12-01 14:15:01 +00:00
Jakub Slowinski 4bc7850465
Fix bug in UnescapedCharSequence and add basic unit tests (#12849) 2023-11-30 10:25:24 -08:00
Michael McCandless 00de0aef63 Avoid null PointValues when merging points in SlowCompositeCodecReaderWrapper (#12859)
* avoid null PointValues when merging points in SlowCompositeCodecReaderWrapper

* null check in SortingCodecReader

---------

Co-authored-by: ChrisHegarty <chegar999@gmail.com>
2023-11-30 09:01:19 -05:00
Chris Hegarty 7919133858
Fix intermittently failing TestSortedSetFieldSource (#12850)
This commit fixes the intermittently failing TestSortedSetFieldSource.

The test assertions depend on doc order which may be affected by merging. The fix is to trivially avoid merging for the very small index, with just two docs.
2023-11-30 08:39:26 +00:00
Mike McCandless 6ba38c13eb #12847: move CHANGES.txt entry to 9.9.0 to match backport 2023-11-29 06:34:24 -05:00
Dzung Bui bbf56f9419
Report the time it took for building the FST in Test2BFST (#12847)
* Report the time it took for building the FST

* Update CHANGES

* Change ramBytesUsed to numBytes

* Report the verification time

* Rename to fstSizeInBytes
2023-11-29 06:17:54 -05:00
Mike McCandless 8703b541a5 #240: disable threads in the random IndexSearcher from newSearcher for this test class 2023-11-28 19:37:21 -05:00
Benjamin Trent 2bb69f3246
Fix *HnswVectorsFormat.testIndexedValueNotAliased test flakiness (#12848) 2023-11-28 14:50:48 -05:00
ThomasDC 502f15a89b
Let WordDelimiterGraphFilterFactory propagate ignoreKeywords flag (#12525)
* Let WordDelimiterGraphFilterFactory propagate ignoreKeywords flag

fixes https://github.com/apache/lucene/issues/12522

* Document changes

* Align with default in code
2023-11-28 12:28:07 -05:00
Jakub Slowinski 203f506130
CheckIndex - Adding a `-level` parameter to give ability to control index check detail programmatically (#12797)
* CheckIndex - Making -fast the default behaviour

1. Making -fast the new default.
2. The previous -slow is moved to -slower
3. The previous default behavior (checksum + segment file content) is activated by -slow.

* gradlew tidy

* Add changes.txt

* Moved change to Lucene 10.0, now using -detailLevel param

* Fix failing test

* Add MIGRATE.md note and comment to remove deprecated params

* Fix failing unit test

* Changing detailLevel -> level

* catch invalid API calls

* Update lucene/core/src/java/org/apache/lucene/index/CheckIndex.java

Co-authored-by: Adrien Grand <jpountz@gmail.com>

---------

Co-authored-by: Adrien Grand <jpountz@gmail.com>
2023-11-28 12:19:31 -05:00
gf2121 9574cbd1f1
Optimize outputs accumulating for SegmentTermsEnum and IntersectTermsEnum (#12699) 2023-11-28 13:04:41 +08:00
Zach Chen 38ca8d3e42
LUCENE-10002: Deprecate IndexSearch#search(Query, Collector) in favor of IndexSearcher#search(Query, CollectorManager) - TopFieldCollectorManager & TopScoreDocCollectorManager (#240) 2023-11-27 16:16:31 -08:00
Uwe Schindler 17bb73332c
Only enable support for tests.profile if jdk.jfr module is available in Gradle runtime (#12845) 2023-11-25 20:16:09 +01:00
Ignacio Vera 74085cd1b0
Hide the internal data structure of HeapPointWriter (#12762) 2023-11-24 13:58:39 +01:00
Peter Gromov f460d612b5
hunspell: allow in-memory entry sorting for faster dictionary loading (#12834)
* hunspell: allow in-memory entry sorting for faster dictionary loading

Co-authored-by: Dawid Weiss <dawid.weiss@gmail.com>
2023-11-24 08:21:43 +01:00
Simon Willnauer 981339be04
Move MergeState.DocMap to a FunctionalInterface (#12836)
This change converts MergeState to an interface to make use of lambda expressions.
2023-11-23 20:39:15 +01:00
Adrien Grand 0ec7fdb3b5 Revert "Simplify advancing on postings/impacts enums (#12810)"
This reverts commit 5aa401e7d8.
2023-11-23 18:19:12 +01:00
Adrien Grand 14cee15c08 Fix test to preserve index order. 2023-11-23 13:37:56 +01:00
Adrien Grand 5aa401e7d8
Simplify advancing on postings/impacts enums (#12810) 2023-11-23 13:32:08 +01:00
Adrien Grand f7cab16450
Add a merge policy wrapper that performs recursive graph bisection on merge. (#12622)
This adds `BPReorderingMergePolicy`, a merge policy wrapper that reorders doc
IDs on merge using a `BPIndexReorderer`.
 - Reordering always run on forced merges.
 - A `minNaturalMergeNumDocs` parameter helps only enable reordering on the
   larger merged segments. This way, small merges retain all merging
   optimizations like bulk copying of stored fields, and only the larger
   segments - which are the most important for search performance - get
   reordered.
 - If not enough RAM is available to perform reordering, reordering is skipped.

To make this work, I had to add the ability for any merge to reorder doc IDs of
the merged segment via `OneMerge#reorder`. `MockRandomMergePolicy` from the
test framework randomly reverts the order of documents in a merged segment to
make sure this logic is properly exercised.
2023-11-23 13:25:00 +01:00
gf2121 76fe6bdbc1
Improve DirectReader java doc (#12835) 2023-11-23 17:19:57 +08:00
Michael Sokolov 74fe7f7fdf change-log entry for #12817 2023-11-22 17:13:01 -05:00
Stefan Vodita a3794ca6c2
Add KeywordField and StringValueFacetCounts example (#12817) 2023-11-22 11:32:05 -05:00
Adrien Grand 79cad27a42
Improve group-varint benchmark to reproduce value distribution of wikbigall. (#12833)
Instead of using a fixed number of bits per value, the group-varint benchmark
now tries to reproduce the distribution of the number of bits per values that
can be observed on tail postings of wikibigall.
2023-11-22 14:57:48 +01:00
Dzung Bui e04793d651
Remove FST constructors with DataInput for metadata (#12803)
* Remove FST constructor

* Move Outputs to FSTMetadata
2023-11-22 08:21:59 -05:00
Dzung Bui 9b324a180f
Make FSTCompiler.Builder build() throw IOException (#12830) 2023-11-22 07:54:55 -05:00
Adrien Grand 5bc608dbad
Skip decoding tail freqs when they are not needed. (#12832)
When we moved to group-varint for tail postings, we stop interleaving docs and
freqs and instead wrote all docs first, then all freqs. This means that we can
now skip decoding frequencies when they are not needed.
2023-11-22 10:05:41 +01:00
Shubham Chaudhary 4628327af0
Make TaskExecutor cx public and use TaskExecutor for concurrent HNSW graph build (#12799)
Make the TaskExecutor public which is currently pkg-private. At indexing time we concurrently create the hnsw graph (Concurrent HNSW Merge #12660). We could use the TaskExecutor implementation to do this for us.
Use TaskExecutor#invokeAll in HnswConcurrentMergeBuilder#build to run the workers concurrently.
2023-11-21 17:24:01 +01:00
Dzung Bui 4309917215
Remove FSTReader.size() (#12802)
* Move size() to FSTStore

* Remove size() completely

---------

Co-authored-by: Michael McCandless <mikemccand@apache.org>
2023-11-21 08:05:41 -05:00
Dzung Bui d0e0f6090e
Simplify BytesStore operation (#12814)
* Simplify BytesStore operations

* remove writeInt()
2023-11-21 07:26:47 -05:00
Evgeniy Mustafin 4991e3a1f4
Fix PayloadFilteredTermIntervalsSource equals (#12827)
Co-authored-by: Evgeniy Mustafin <evmustafin@ozon.ru>
2023-11-21 05:31:17 -05:00
Peter Gromov c23b3b3301
hunspell: a couple micro-optimizations to speed up dictionary loading (#12825)
* hunspell: a couple micro-optimizations to speed up dictionary loading

1. sort by the whole entry without searching for separators first: WordStorage doesn't require strong lexicographic order (only something close to it), and the separators are anyway before any usual word characters
2. avoid stream overhead when adding an entry
2023-11-21 08:05:42 +01:00
Mike McCandless 7eb8f6ee00 #12542, #12735, #12695, #12709, #12816: move CHANGES.txt entry from 10.0 -> 9.9.0 on bulk backport of recent FST improvements 2023-11-20 14:08:31 -05:00
Stefan Vodita 9de0936a7f
Fix off-by-one error in SimpleSortedSetFacetsExample (#12818) 2023-11-20 16:48:36 +00:00
Zhang Chao d0f63ec530
Use group-varint encoding for the tail of postings (#12782)
Co-authored-by: Adrien Grand <jpountz@gmail.com>
2023-11-20 11:06:13 +01:00
Adrien Grand 194a500323 Fix test failure on empty paged bytes. 2023-11-20 09:23:26 +01:00
Jakub Slowinski b3ef869681
Adding HumanReadableQuery with a descrition param, used for debugging print output (#12816) 2023-11-18 08:21:19 +01:00
Adrien Grand 48e234d988
Remove delayed seek optimization. (#12815)
I think that this optimization was introduced because `advanceShallow` may
advance skip lists and then never decode a block of postings. But actually
`IndexInput#seek` is cheap, including on `NIOFSDirectory`. So let's seek
immediately?
2023-11-18 08:11:07 +01:00
Shibi Balamurugan 6db09131d6
Fix segmentInfos replace doesn't set userData (#12626) 2023-11-17 18:53:05 +01:00
Michael McCandless de820b67cc
Fix CheckIndex to detect major corruption with old (not the latest) commit point (#12530)
* #7820: add initial (failing) test case exposing the bug in CheckIndex

* #7820: initial fix to CheckIndex to detect 'on load' corruption of older segments files

* exclamation point police

* tidy

* add missing @Override in new test case

* fold feedback: merge SIS-loading logic into single for-loop; rename sis -> lastCommit

* tidy

* sidestep segments.gen file as well in case we are reading very old index

* tidy

* always load last commit point first so if it has an issue that will not be masked by issues with older commit points
2023-11-17 12:50:39 -05:00
Jeff Zemerick c228e4bb66
GITHUB#11277, LUCENE-10241: Upgrade to OpenNLP to 1.9.4. (#448) 2023-11-17 15:51:31 +00:00
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