Commit Graph

36216 Commits

Author SHA1 Message Date
Adrien Grand 216e38a159
Synchronize FieldInfos#verifyFieldInfos. (#1019)
This method is called from `addIndexes` and should be synchronized so that it
would see consistent data structures in case of concurrent indexing that would
be introducing new fields.

I hit a rare test failure of `TestIndexRearranger` that I can only explain by this lack of locking:

```
15:40:14    >     java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot read field "numDimensions" because "props" is null
15:40:14    >         at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
15:40:14    >         at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)
15:40:14    >         at org.apache.lucene.misc.index.IndexRearranger.execute(IndexRearranger.java:98)
15:40:14    >         at org.apache.lucene.misc.index.TestIndexRearranger.testRearrangeUsingBinaryDocValueSelector(TestIndexRearranger.java:97)
15:40:14    >         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
15:40:14    >         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
15:40:14    >         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
15:40:14    >         at java.base/java.lang.reflect.Method.invoke(Method.java:568)
15:40:14    >         at randomizedtesting.runner@2.8.0/com.carrotsearch.randomizedtesting.RandomizedRunner.invoke(RandomizedRunner.java:1758)
15:40:14    >         at randomizedtesting.runner@2.8.0/com.carrotsearch.randomizedtesting.RandomizedRunner$8.evaluate(RandomizedRunner.java:946)
15:40:14    >         at randomizedtesting.runner@2.8.0/com.carrotsearch.randomizedtesting.RandomizedRunner$9.evaluate(RandomizedRunner.java:982)
15:40:14    >         at randomizedtesting.runner@2.8.0/com.carrotsearch.randomizedtesting.RandomizedRunner$10.evaluate(RandomizedRunner.java:996)
15:40:14    >         at org.apache.lucene.test_framework@10.0.0-SNAPSHOT/org.apache.lucene.tests.util.TestRuleSetupTeardownChained$1.evaluate(TestRuleSetupTeardownChained.java:44)
15:40:14    >         at org.apache.lucene.test_framework@10.0.0-SNAPSHOT/org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
15:40:14    >         at org.apache.lucene.test_framework@10.0.0-SNAPSHOT/org.apache.lucene.tests.util.TestRuleThreadAndTestName$1.evaluate(TestRuleThreadAndTestName.java:45)
15:40:14    >         at org.apache.lucene.test_framework@10.0.0-SNAPSHOT/org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
15:40:14    >         at org.apache.lucene.test_framework@10.0.0-SNAPSHOT/org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
15:40:14    >         at junit@4.13.1/org.junit.rules.RunRules.evaluate(RunRules.java:20)
15:40:14    >         at randomizedtesting.runner@2.8.0/com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
15:40:14    >         at randomizedtesting.runner@2.8.0/com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
15:40:14    >         at randomizedtesting.runner@2.8.0/com.carrotsearch.randomizedtesting.ThreadLeakControl.forkTimeoutingTask(ThreadLeakControl.java:843)
15:40:14    >         at randomizedtesting.runner@2.8.0/com.carrotsearch.randomizedtesting.ThreadLeakControl$3.evaluate(ThreadLeakControl.java:490)
15:40:14    >         at randomizedtesting.runner@2.8.0/com.carrotsearch.randomizedtesting.RandomizedRunner.runSingleTest(RandomizedRunner.java:955)
15:40:14    >         at randomizedtesting.runner@2.8.0/com.carrotsearch.randomizedtesting.RandomizedRunner$5.evaluate(RandomizedRunner.java:840)
15:40:14    >         at randomizedtesting.runner@2.8.0/com.carrotsearch.randomizedtesting.RandomizedRunner$6.evaluate(RandomizedRunner.java:891)
15:40:14    >         at randomizedtesting.runner@2.8.0/com.carrotsearch.randomizedtesting.RandomizedRunner$7.evaluate(RandomizedRunner.java:902)
15:40:14    >         at org.apache.lucene.test_framework@10.0.0-SNAPSHOT/org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
15:40:14    >         at randomizedtesting.runner@2.8.0/com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
15:40:14    >         at org.apache.lucene.test_framework@10.0.0-SNAPSHOT/org.apache.lucene.tests.util.TestRuleStoreClassName$1.evaluate(TestRuleStoreClassName.java:38)
15:40:14    >         at randomizedtesting.runner@2.8.0/com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
15:40:14    >         at randomizedtesting.runner@2.8.0/com.carrotsearch.randomizedtesting.rules.NoShadowingOrOverridesOnMethodsRule$1.evaluate(NoShadowingOrOverridesOnMethodsRule.java:40)
15:40:14    >         at randomizedtesting.runner@2.8.0/com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
15:40:14    >         at randomizedtesting.runner@2.8.0/com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
15:40:14    >         at org.apache.lucene.test_framework@10.0.0-SNAPSHOT/org.apache.lucene.tests.util.TestRuleAssertionsRequired$1.evaluate(TestRuleAssertionsRequired.java:53)
15:40:14    >         at org.apache.lucene.test_framework@10.0.0-SNAPSHOT/org.apache.lucene.tests.util.AbstractBeforeAfterRule$1.evaluate(AbstractBeforeAfterRule.java:43)
15:40:14    >         at org.apache.lucene.test_framework@10.0.0-SNAPSHOT/org.apache.lucene.tests.util.TestRuleMarkFailure$1.evaluate(TestRuleMarkFailure.java:44)
15:40:14    >         at org.apache.lucene.test_framework@10.0.0-SNAPSHOT/org.apache.lucene.tests.util.TestRuleIgnoreAfterMaxFailures$1.evaluate(TestRuleIgnoreAfterMaxFailures.java:60)
15:40:14    >         at org.apache.lucene.test_framework@10.0.0-SNAPSHOT/org.apache.lucene.tests.util.TestRuleIgnoreTestSuites$1.evaluate(TestRuleIgnoreTestSuites.java:47)
15:40:14    >         at junit@4.13.1/org.junit.rules.RunRules.evaluate(RunRules.java:20)
15:40:14    >         at randomizedtesting.runner@2.8.0/com.carrotsearch.randomizedtesting.rules.StatementAdapter.evaluate(StatementAdapter.java:36)
15:40:14    >         at randomizedtesting.runner@2.8.0/com.carrotsearch.randomizedtesting.ThreadLeakControl$StatementRunner.run(ThreadLeakControl.java:390)
15:40:14    >         at randomizedtesting.runner@2.8.0/com.carrotsearch.randomizedtesting.ThreadLeakControl.lambda$forkTimeoutingTask$0(ThreadLeakControl.java:850)
15:40:14    >         at java.base/java.lang.Thread.run(Thread.java:833)
15:40:14    >
15:40:14    >         Caused by:
15:40:14    >         java.lang.NullPointerException: Cannot read field "numDimensions" because "props" is null
15:40:14    >             at org.apache.lucene.core@10.0.0-SNAPSHOT/org.apache.lucene.index.FieldInfos$FieldNumbers.verifySameSchema(FieldInfos.java:459)
15:40:14    >             at org.apache.lucene.core@10.0.0-SNAPSHOT/org.apache.lucene.index.FieldInfos$FieldNumbers.verifyFieldInfo(FieldInfos.java:359)
15:40:14    >             at org.apache.lucene.core@10.0.0-SNAPSHOT/org.apache.lucene.index.IndexWriter.addIndexes(IndexWriter.java:3149)
15:40:14    >             at org.apache.lucene.misc.index.IndexRearranger.addOneSegment(IndexRearranger.java:139)
15:40:14    >             at org.apache.lucene.misc.index.IndexRearranger.lambda$execute$0(IndexRearranger.java:92)
15:40:14    >             at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
15:40:14    >             at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
15:40:14    >             at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
15:40:14    >             ... 1 more
```
2022-07-18 16:17:29 +02:00
Adrien Grand 0364402b30 Fix rare test failures of TestIndexSorting.
Sometimes the final merge might not require sorting depending on the merge
policy configuration.
2022-07-18 15:26:08 +02:00
Vigya Sharma 30a7c52e6c
LUCENE-10649: Fix failures in TestDemoParallelLeafReader (#1025) 2022-07-18 14:32:38 +02:00
Tomoko Uchida 8938e6a3fa
LUCENE-10557: Add GitHub issue templates (#1024) 2022-07-18 15:33:00 +09:00
Greg Miller 9b185b99c4
LUCENE-10603: Remove SSDV#NO_MORE_ORDS definition (#1021) 2022-07-13 20:02:17 -07:00
Vigya Sharma ca7917472b
LUCENE-10648: Fix failures in TestAssertingPointsFormat.testWithExceptions (#1012)
* Fix failures in TestAssertingPointsFormat.testWithExceptions

* remove redundant finally block

* tidy

* remove TODO as it is done now
2022-07-13 13:55:08 -04:00
Christine Poerschke 56462b5f96
LUCENE-10523: factor out UnifiedHighlighter.newFieldHighlighter() method (#821) 2022-07-13 18:43:31 +01:00
Greg Miller 7c35311f29
Specialize ordinal encoding for SortedSetDocValues (#1010) 2022-07-12 18:55:54 -07:00
tang donghai d7c2def019
LUCENE-10619: Optimize the writeBytes in TermsHashPerField (#966) 2022-07-12 17:14:37 +02:00
Greg Miller d6dbe4374a Move LUCENE-10614 CHANGES entry to 10.0 and add MIGRATE entry 2022-07-11 09:10:58 -07:00
Yuting Gan 5ef7e5025d
LUCENE-10614: Properly support getTopChildren in RangeFacetCounts (#974) 2022-07-11 09:04:46 -07:00
Vigya Sharma 128869d63a
LUCENE-10647: Fix TestMergeSchedulerExternal failures (#1011)
Ensure mergeScheduler.sync() gets called before we rollback the writer.
2022-07-11 11:23:17 +02:00
Vigya Sharma c06b98262c
add comment for no pauses in writeBytes (#1014) 2022-07-11 11:12:00 +02:00
Stefan Vodita dd4e8b82d7
LUCENE-10603: Stop using SortedSetDocValues.NO_MORE_ORDS in tests (#1004) 2022-07-07 09:54:41 -07:00
zacharymorn da8143bfa3
LUCENE-10480: Move scoring from advance to TwoPhaseIterator#matches to improve disjunction within conjunction (#1006) 2022-07-07 01:10:50 -07:00
Vigya Sharma 698f40ad51
LUCENE-10216: Use MergeScheduler and MergePolicy to run addIndexes(CodecReader[]) merges. (#633)
* Use merge policy and merge scheduler to run addIndexes merges

* wrapped reader does not see deletes - debug

* Partially fixed tests in TestAddIndexes

* Use writer object to invoke addIndexes merge

* Use merge object info

* Add javadocs for new methods

* TestAddIndexes passing

* verify field info schemas upfront from incoming readers

* rename flag to track pooled readers

* Keep addIndexes API transactional

* Maintain transactionality - register segments with iw after all merges complete

* fix checkstyle

* PR comments

* Fix pendingDocs - numDocs mismatch bug

* Tests with 1-1 merges and partial merge failures

* variable renaming and better comments

* add test for partial merge failures. change tests to use 1-1 findmerges

* abort pending merges gracefully

* test null and empty merge specs

* test interim files are deleted

* test with empty readers

* test cascading merges triggered

* remove nocommits

* gradle check errors

* remove unused line

* remove printf

* spotless apply

* update TestIndexWriterOnDiskFull to accept mergeException from failing addIndexes calls

* return singleton reader mergespec in NoMergePolicy

* rethrow exceptions seen in merge threads on failure

* spotless apply

* update test to new exception type thrown

* spotlessApply

* test for maxDoc limit in IndexWriter

* spotlessApply

* Use DocValuesIterator instead of DocValuesFieldExistsQuery for counting soft deletes

* spotless apply

* change exception message for closed IW

* remove non-essential comments

* update api doc string

* doc string update

* spotless

* Changes file entry

* simplify findMerges API, add 1-1 merges to MockRandomMergePolicy

* update merge policies to new api

* remove unused imports

* spotless apply

* move changes entry to end of list

* fix testAddIndicesWithSoftDeletes

* test with 1-1 merge policy always enabled

* please spotcheck

* tidy

* test - never use 1-1 merge policy

* use 1-1 merge policy randomly

* Remove concurrent addIndexes findMerges from MockRandomMergePolicy

* Bug Fix: RuntimeException in addIndexes

Aborted pending merges were slipping through the merge exception check in
API, and getting caught later in the RuntimeException check.

* tidy

* Rebase on main. Move changes to 10.0

* Synchronize IW.AddIndexesMergeSource on outer class IW object

* tidy
2022-07-06 18:15:47 -04:00
Peter Gromov d537013e70
LUCENE-10626: Hunspell: add tools to aid dictionary editing: analysis introspection, stem expansion and stem/flag suggestion (#975) 2022-07-05 21:38:03 +02:00
Adrien Grand 3dd9a5487c
LUCENE-10636: Avoid computing the same scores multiple times. (#1005)
`BlockMaxMaxscoreScorer` would previously compute the score twice for essential
scorers.

Co-authored-by: zacharymorn <zacharymorn@gmail.com>
2022-07-05 10:14:02 +02:00
Adrien Grand 81d4a7a69f
LUCENE-10151: Some fixes to query timeouts. (#996)
I noticed some minor bugs in the original PR #927 that this PR should fix:
 - When a timeout is set, we would no longer catch
   `CollectionTerminatedException`.
 - I added randomization to `LuceneTestCase` to randomly set a timeout, it
   would have caught the above bug.
 - Fixed visibility of `TimeLimitingBulkScorer`.
2022-07-04 17:32:38 +02:00
zacharymorn 503ec55973
LUCENE-10480: Use BMM scorer for 2 clauses disjunction (#972) 2022-07-02 13:26:16 -07:00
Julie Tibshirani 187f843e2a
LUCENE-10577: Add vectors format unit test and fix toString (#998)
We forgot to add this unit test when introducing the new 9.3 vectors format.
This commit adds the test and fixes issues it uncovered in toString.
2022-07-02 19:00:29 +02:00
Uwe Schindler fb617e29d0 Remove deprecations in main (#978) 2022-07-01 16:32:50 +02:00
Uwe Schindler 8a70988e63
Remove/deprecate obsolete constants in oal.util.Constants; remove code which is no longer executed after Java 9 (#978) 2022-07-01 16:24:18 +02:00
Greg Miller 5f2a4998a0
LUCENE-10603: Migrate remaining SSDV iteration to use docValueCount in production code (#995) 2022-06-30 14:01:14 -07:00
Greg Miller e05b3ec7de Add missing CHANGES entries for GH#983 and GH#984 2022-06-29 13:08:01 -07:00
Greg Miller bede1c3e8c
Switch Float/IntTaxonomyFacets to primitive list data structures in getAllChildren (#984) 2022-06-29 13:01:59 -07:00
Greg Miller 5c3d92d69d
Some refactoring/cleanup of AbstractSortedSetDocValueFacetCounts (#983) 2022-06-29 13:01:47 -07:00
Michael Sokolov e078bc1cd9 fix minor style issues in test 2022-06-29 11:09:46 -04:00
Michael Sokolov 95de554b65 CHANGES entry for LUCENE-10151 2022-06-29 10:35:09 -04:00
Deepika0510 af05550ebf
LUCENE-10151: Adding Timeout Support to IndexSearcher (#927)
Authored-by: Deepika Sharma <dpshrma@amazon.com>
2022-06-29 10:32:12 -04:00
Tomoko Uchida 64321114e1
LUCENE-10557: temprarily enable github issue (#988) 2022-06-29 13:27:53 +09:00
Dawid Weiss 5328a70a29
Update randomizedtesting to 2.8.0, hppc to 0.9.1, morfologik to 2.1.9. (#991) 2022-06-28 15:42:07 +02:00
Alessandro Benedetti 8cf694fed2
LUCENE-10593: VectorSimilarityFunction reverse removal (#926)
* Vector Similarity Function reverse property removed

* NeighborQueue tie-breaking fixed (node id + node score encoding)

* NeighborQueue readability refactor

* BoundChecker removal (now it's only in backward-codecs)
2022-06-28 15:33:11 +02:00
Lu Xugang 3e74ebbc0d
Add entry (#990) 2022-06-28 12:03:18 +08:00
Lu Xugang d8fb47b674
LUCENE-10623: Error implementation of docValueCount for SortingSortedSetDocValues (#967) 2022-06-28 11:49:47 +08:00
Julie Tibshirani 7b58088bd5
Fix FieldExistsQuery rewrite when all docs have vectors (#986)
Before we were checking the number of vectors in the segment against the total
number of documents in IndexReader. This meant FieldExistsQuery would not
rewrite to MatchAllDocsQuery when there were multiple segments.
2022-06-27 09:59:53 +02:00
Kaival Parikh 03846b468e
LUCENE-10606: For KnnVectorQuery, optimize case where filter is backed by BitSetIterator (#951)
Instead of collecting hit-by-hit using a `LeafCollector`, we break down the
search by instantiating a weight, creating scorers, and checking the underlying
iterator. If it is backed by a `BitSet`, we directly update the reference (as
we won't be editing the `Bits`). Else we can create a new `BitSet` from the
iterator using `BitSet.of`.
2022-06-27 08:52:52 +02:00
Shai Erera 9338909373
Fix typos and minor refactoring to FacetConfig (#982) 2022-06-27 07:34:21 +03:00
Shai Erera ef486ea11a Use TestUtil.nextInt() instead of random().nextInt() 2022-06-25 18:13:38 +03:00
Marc D'mello f6bb9d218c
LUCENE-10274: Add FacetSets faceting capabilities (#841)
Co-authored-by: Marc D'Mello <dmellomd@amazon.com>
Co-authored-by: Shai Erera <serera@gmail.com>
Co-authored-by: Greg Miller <gsmiller@gmail.com>
2022-06-25 17:27:11 +03:00
Uwe Schindler eafc6420f3
Exclude Lucene's own JAR files from classpath entries in Eclipse config (#976) 2022-06-24 19:42:42 +02:00
Christine Poerschke 9199d48e7e
Remove outdated comment in UnifiedHighlighter.get(Formatter|Scorer) javadoc. (#820) 2022-06-24 18:00:28 +01:00
Luca Cavanna 2ccec3deb7
Rework TestElevationComparator (#980)
The test used to leave hanging threads behind following a failure. Also one method was executing two different tests. I split the existing method into two and I am now leveraging setup and teardown to properly close all the resources both when the tests succeed as well as whey they fail.
2022-06-24 18:11:51 +02:00
Uwe Schindler 831ae2465b
Remove the deflater hack introduced because of JDK-8252739 (#977)
This bug was fixed in JDK-16 so it does not apply to main branch (Java 17) anymore.
2022-06-24 14:23:10 +02:00
Adrien Grand 4c1ae2a332
LUCENE-10620: Pass the Weight to Collectors. (#964)
This allows `Collector`s to use `Weight#count` when appropriate.
2022-06-23 17:56:15 +02:00
tang donghai 2da9951f23
LUCENE-10607: Fix potential integer overflow in maxArcs computions (#970) 2022-06-22 22:23:36 +02:00
Gautam Worah bc72a53efc
Index only the docs for FacetField posting list (#922) 2022-06-22 12:09:56 -07:00
Mike Drob 3ca108fb73
Add back-compat indices for 8.11.2 2022-06-22 10:29:58 -07:00
Mike Drob 05b1465d36
Sync CHANGES for 8.11.2 2022-06-21 22:59:01 -07:00
Mike Drob 4eb53df424
Add bugfix version 8.11.2 2022-06-21 22:17:51 -07:00