You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ds...@apache.org on 2023/04/05 04:47:28 UTC
[solr] branch branch_9x updated (4d66250c84e -> 8ba4e582ea5)
This is an automated email from the ASF dual-hosted git repository.
dsmiley pushed a change to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
from 4d66250c84e Remove unused joda-time version (#1540)
new d8d30d8add0 SOLR 16642 : upgrade Solr to use Lucene 9.5.0 (#1360)
new 8ba4e582ea5 SOLR-16693: timeAllowed: use TimeLimitingBulkScorer (#1450)
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
solr/CHANGES.txt | 6 +-
solr/bin/solr | 6 --
solr/bin/solr.cmd | 7 --
.../org/apache/solr/core/MMapDirectoryFactory.java | 13 ++--
.../org/apache/solr/core/SchemaCodecFactory.java | 10 +--
.../apache/solr/handler/MoreLikeThisHandler.java | 2 +-
.../solr/handler/admin/IndexSizeEstimator.java | 2 +-
.../solr/index/SlowCompositeReaderWrapper.java | 57 ++++++++-------
.../apache/solr/parser/SolrQueryParserBase.java | 9 +--
.../org/apache/solr/schema/DenseVectorField.java | 4 +-
.../org/apache/solr/search/SolrIndexSearcher.java | 80 +++++++++++++---------
.../apache/solr/search/SolrQueryTimeoutImpl.java | 14 +++-
.../solr/spelling/suggest/DictionaryFactory.java | 3 +-
.../suggest/DocumentDictionaryFactory.java | 3 +-
.../DocumentExpressionDictionaryFactory.java | 3 +-
.../processor/ClassificationUpdateProcessor.java | 30 +++++---
.../org/apache/solr/core/TestCodecSupport.java | 2 +-
.../solr/handler/admin/IndexSizeEstimatorTest.java | 2 +-
.../solr/index/TestSlowCompositeReaderWrapper.java | 30 --------
.../search/TestComplexPhraseQParserPlugin.java | 22 +++---
.../test/org/apache/solr/search/TestDocSet.java | 28 +++++++-
.../AtomicUpdateProcessorFactoryTest.java | 2 +-
.../UpdateRequestProcessorFactoryTest.java | 3 +-
solr/licenses/antlr4-runtime-4.11.1.jar.sha1 | 1 +
solr/licenses/antlr4-runtime-4.5.1-1.jar.sha1 | 1 -
.../licenses/lucene-analysis-common-9.4.2.jar.sha1 | 1 -
.../licenses/lucene-analysis-common-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-analysis-icu-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-analysis-icu-9.5.0.jar.sha1 | 1 +
.../lucene-analysis-kuromoji-9.4.2.jar.sha1 | 1 -
.../lucene-analysis-kuromoji-9.5.0.jar.sha1 | 1 +
.../lucene-analysis-morfologik-9.4.2.jar.sha1 | 1 -
.../lucene-analysis-morfologik-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-analysis-nori-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-analysis-nori-9.5.0.jar.sha1 | 1 +
.../lucene-analysis-opennlp-9.4.2.jar.sha1 | 1 -
.../lucene-analysis-opennlp-9.5.0.jar.sha1 | 1 +
.../lucene-analysis-phonetic-9.4.2.jar.sha1 | 1 -
.../lucene-analysis-phonetic-9.5.0.jar.sha1 | 1 +
.../lucene-analysis-smartcn-9.4.2.jar.sha1 | 1 -
.../lucene-analysis-smartcn-9.5.0.jar.sha1 | 1 +
.../lucene-analysis-stempel-9.4.2.jar.sha1 | 1 -
.../lucene-analysis-stempel-9.5.0.jar.sha1 | 1 +
.../licenses/lucene-backward-codecs-9.4.2.jar.sha1 | 1 -
.../licenses/lucene-backward-codecs-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-classification-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-classification-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-codecs-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-codecs-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-core-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-core-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-expressions-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-expressions-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-grouping-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-grouping-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-highlighter-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-highlighter-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-join-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-join-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-memory-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-memory-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-misc-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-misc-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-queries-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-queries-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-queryparser-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-queryparser-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-sandbox-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-sandbox-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-spatial-extras-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-spatial-extras-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-spatial3d-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-spatial3d-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-suggest-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-suggest-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-test-framework-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-test-framework-9.5.0.jar.sha1 | 1 +
...ExtractNamedEntitiesUpdateProcessorFactory.java | 32 ++++-----
.../solr/configsets/_default/conf/solrconfig.xml | 2 +-
.../conf/solrconfig.xml | 2 +-
versions.lock | 54 +++++++--------
versions.props | 2 +-
82 files changed, 256 insertions(+), 228 deletions(-)
create mode 100644 solr/licenses/antlr4-runtime-4.11.1.jar.sha1
delete mode 100644 solr/licenses/antlr4-runtime-4.5.1-1.jar.sha1
delete mode 100644 solr/licenses/lucene-analysis-common-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-analysis-common-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-analysis-icu-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-analysis-icu-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-analysis-kuromoji-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-analysis-kuromoji-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-analysis-morfologik-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-analysis-morfologik-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-analysis-nori-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-analysis-nori-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-analysis-opennlp-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-analysis-opennlp-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-analysis-phonetic-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-analysis-phonetic-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-analysis-smartcn-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-analysis-smartcn-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-analysis-stempel-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-analysis-stempel-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-backward-codecs-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-backward-codecs-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-classification-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-classification-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-codecs-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-codecs-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-core-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-core-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-expressions-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-expressions-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-grouping-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-grouping-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-highlighter-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-highlighter-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-join-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-join-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-memory-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-memory-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-misc-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-misc-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-queries-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-queries-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-queryparser-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-queryparser-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-sandbox-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-sandbox-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-spatial-extras-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-spatial-extras-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-spatial3d-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-spatial3d-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-suggest-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-suggest-9.5.0.jar.sha1
delete mode 100644 solr/licenses/lucene-test-framework-9.4.2.jar.sha1
create mode 100644 solr/licenses/lucene-test-framework-9.5.0.jar.sha1
[solr] 02/02: SOLR-16693: timeAllowed: use TimeLimitingBulkScorer (#1450)
Posted by ds...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
dsmiley pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
commit 8ba4e582ea5f8fcbf030fb88cadd8013a1ee6454
Author: David Smiley <ds...@salesforce.com>
AuthorDate: Tue Apr 4 00:21:11 2023 -0400
SOLR-16693: timeAllowed: use TimeLimitingBulkScorer (#1450)
For timeAllowed: use more efficient TimeLimitingBulkScorer instead of ExitableDirectoryReader
Added sys prop escape hatch: solr.useExitableDirectoryReader
---
solr/CHANGES.txt | 2 +
.../org/apache/solr/search/SolrIndexSearcher.java | 66 +++++++++++++++-------
.../apache/solr/search/SolrQueryTimeoutImpl.java | 13 +++++
3 files changed, 61 insertions(+), 20 deletions(-)
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 3ffb07d6bf4..e1c405da0ce 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -45,6 +45,8 @@ Optimizations
Solr can also be started with the system property `solr.http.disableCookies` set to `true`, so that the internal clients
that Solr uses to communicate between nodes use `HttpCookieStore.Empty`. (Tomás Fernández Löbbe)
+* SOLR-16693: For query timeAllowed, switch from ExitableDirectoryReader to TimeLimitingBulkScorer (David Smiley)
+
Bug Fixes
---------------------
diff --git a/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java b/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
index b12db8b8772..70a5292ce75 100644
--- a/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
+++ b/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
@@ -81,6 +81,7 @@ import org.apache.lucene.search.TopScoreDocCollector;
import org.apache.lucene.search.TotalHitCountCollector;
import org.apache.lucene.search.TotalHits;
import org.apache.lucene.search.TotalHits.Relation;
+import org.apache.lucene.search.Weight;
import org.apache.lucene.store.AlreadyClosedException;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.Bits;
@@ -133,6 +134,10 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable, SolrI
private static final Map<String, SolrCache<?, ?>> NO_GENERIC_CACHES = Collections.emptyMap();
private static final SolrCache<?, ?>[] NO_CACHES = new SolrCache<?, ?>[0];
+ // If you find this useful, let us know in dev@solr.apache.org. Likely to be removed eventually.
+ private static final boolean useExitableDirectoryReader =
+ Boolean.getBoolean("solr.useExitableDirectoryReader");
+
private final SolrCore core;
private final IndexSchema schema;
private final SolrDocumentFetcher docFetcher;
@@ -197,9 +202,11 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable, SolrI
private static DirectoryReader wrapReader(SolrCore core, DirectoryReader reader)
throws IOException {
assert reader != null;
- return ExitableDirectoryReader.wrap(
- UninvertingReader.wrap(reader, core.getLatestSchema().getUninversionMapper()),
- SolrQueryTimeoutImpl.getInstance());
+ reader = UninvertingReader.wrap(reader, core.getLatestSchema().getUninversionMapper());
+ if (useExitableDirectoryReader) { // SOLR-16693 legacy; may be removed. Probably inefficient.
+ reader = ExitableDirectoryReader.wrap(reader, SolrQueryTimeoutImpl.getInstance());
+ }
+ return reader;
}
/**
@@ -704,23 +711,42 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable, SolrI
return qr;
}
- // FIXME: This option has been dead/noop since 3.1, should we re-enable or remove it?
- // public Hits search(Query query, Filter filter, Sort sort) throws IOException {
- // // todo - when Solr starts accepting filters, need to
- // // change this conditional check (filter!=null) and create a new filter
- // // that ANDs them together if it already exists.
- //
- // if (optimizer==null || filter!=null || !(query instanceof BooleanQuery)
- // ) {
- // return super.search(query,filter,sort);
- // } else {
- // Query[] newQuery = new Query[1];
- // Filter[] newFilter = new Filter[1];
- // optimizer.optimize((BooleanQuery)query, this, 0, newQuery, newFilter);
- //
- // return super.search(newQuery[0], newFilter[0], sort);
- // }
- // }
+ @Override
+ protected void search(List<LeafReaderContext> leaves, Weight weight, Collector collector)
+ throws IOException {
+ final var queryTimeout = SolrQueryTimeoutImpl.getInstance();
+ if (useExitableDirectoryReader || queryTimeout.isTimeoutEnabled() == false) {
+ // no timeout. Pass through to super class
+ super.search(leaves, weight, collector);
+ } else {
+ // Timeout enabled! This impl is maybe a hack. Use Lucene's IndexSearcher timeout.
+ // But only some queries have it so don't use on "this" (SolrIndexSearcher), not to mention
+ // that timedOut() might race with concurrent queries (dubious design).
+ // So we need to make a new IndexSearcher instead of using "this".
+ new IndexSearcher(reader) { // cheap, actually!
+ void searchWithTimeout() throws IOException {
+ setTimeout(queryTimeout.makeLocalImpl());
+ super.search(leaves, weight, collector); // FYI protected access
+ if (timedOut()) {
+ throw new TimeAllowedExceededFromScorerException("timeAllowed exceeded");
+ }
+ }
+ }.searchWithTimeout();
+ }
+ }
+
+ /**
+ * Thrown when {@link org.apache.solr.common.params.CommonParams#TIME_ALLOWED} is exceeded.
+ * Further, from the low level Lucene {@code org.apache.lucene.search.TimeLimitingBulkScorer}.
+ * Extending {@code ExitableDirectoryReader.ExitingReaderException} is for legacy reasons.
+ */
+ public static class TimeAllowedExceededFromScorerException
+ extends ExitableDirectoryReader.ExitingReaderException {
+
+ public TimeAllowedExceededFromScorerException(String msg) {
+ super(msg);
+ }
+ }
/**
* Retrieve the {@link Document} instance corresponding to the document id.
diff --git a/solr/core/src/java/org/apache/solr/search/SolrQueryTimeoutImpl.java b/solr/core/src/java/org/apache/solr/search/SolrQueryTimeoutImpl.java
index bc096ae2ef4..a30bb8d0f6c 100644
--- a/solr/core/src/java/org/apache/solr/search/SolrQueryTimeoutImpl.java
+++ b/solr/core/src/java/org/apache/solr/search/SolrQueryTimeoutImpl.java
@@ -91,4 +91,17 @@ public class SolrQueryTimeoutImpl implements QueryTimeout {
public String toString() {
return "timeoutAt: " + getTimeoutAtNs() + " (System.nanoTime(): " + nanoTime() + ")";
}
+
+ /** Internal impl for speed only used when we know there's a timeout enabled. */
+ QueryTimeout makeLocalImpl() {
+ assert isTimeoutEnabled();
+ return new QueryTimeout() {
+ final long timeoutAt = getTimeoutAtNs();
+
+ @Override
+ public boolean shouldExit() {
+ return timeoutAt - nanoTime() < 0L;
+ }
+ };
+ }
}
[solr] 01/02: SOLR 16642 : upgrade Solr to use Lucene 9.5.0 (#1360)
Posted by ds...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
dsmiley pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
commit d8d30d8add0c9a94be68821f700fde77c4c73a1c
Author: vinayak hegde <vi...@gmail.com>
AuthorDate: Mon Apr 3 22:57:20 2023 -0400
SOLR 16642 : upgrade Solr to use Lucene 9.5.0 (#1360)
* SlowAtomicReader should throw UnsupportedOperationException for all unimplementable methods, namely the nearest-neighbor ones.
* MMapDirectoryFactory no longer supports "unmap" param but can be done differently.
* SlowCompositeReaderWrapper can no longer cache Terms.
* ComplexPhrase QParser: can't highlight when hl.usePhraseHighlighter=false due to UnifiedHighlighter change.
* revert SOLR-16500; Java 19 is supported already by Lucene
* Possible perf regression for timeAllowed param; to be addressed separately
Co-authored-by: David Smiley <ds...@salesforce.com>
---
solr/CHANGES.txt | 4 +-
solr/bin/solr | 6 ---
solr/bin/solr.cmd | 7 ---
.../org/apache/solr/core/MMapDirectoryFactory.java | 13 +++--
.../org/apache/solr/core/SchemaCodecFactory.java | 10 ++--
.../apache/solr/handler/MoreLikeThisHandler.java | 2 +-
.../solr/handler/admin/IndexSizeEstimator.java | 2 +-
.../solr/index/SlowCompositeReaderWrapper.java | 57 +++++++++++++---------
.../apache/solr/parser/SolrQueryParserBase.java | 9 ++--
.../org/apache/solr/schema/DenseVectorField.java | 4 +-
.../org/apache/solr/search/SolrIndexSearcher.java | 14 +-----
.../apache/solr/search/SolrQueryTimeoutImpl.java | 1 -
.../solr/spelling/suggest/DictionaryFactory.java | 3 +-
.../suggest/DocumentDictionaryFactory.java | 3 +-
.../DocumentExpressionDictionaryFactory.java | 3 +-
.../processor/ClassificationUpdateProcessor.java | 30 +++++++-----
.../org/apache/solr/core/TestCodecSupport.java | 2 +-
.../solr/handler/admin/IndexSizeEstimatorTest.java | 2 +-
.../solr/index/TestSlowCompositeReaderWrapper.java | 30 ------------
.../search/TestComplexPhraseQParserPlugin.java | 22 ++++-----
.../test/org/apache/solr/search/TestDocSet.java | 28 ++++++++++-
.../AtomicUpdateProcessorFactoryTest.java | 2 +-
.../UpdateRequestProcessorFactoryTest.java | 3 +-
solr/licenses/antlr4-runtime-4.11.1.jar.sha1 | 1 +
solr/licenses/antlr4-runtime-4.5.1-1.jar.sha1 | 1 -
.../licenses/lucene-analysis-common-9.4.2.jar.sha1 | 1 -
.../licenses/lucene-analysis-common-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-analysis-icu-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-analysis-icu-9.5.0.jar.sha1 | 1 +
.../lucene-analysis-kuromoji-9.4.2.jar.sha1 | 1 -
.../lucene-analysis-kuromoji-9.5.0.jar.sha1 | 1 +
.../lucene-analysis-morfologik-9.4.2.jar.sha1 | 1 -
.../lucene-analysis-morfologik-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-analysis-nori-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-analysis-nori-9.5.0.jar.sha1 | 1 +
.../lucene-analysis-opennlp-9.4.2.jar.sha1 | 1 -
.../lucene-analysis-opennlp-9.5.0.jar.sha1 | 1 +
.../lucene-analysis-phonetic-9.4.2.jar.sha1 | 1 -
.../lucene-analysis-phonetic-9.5.0.jar.sha1 | 1 +
.../lucene-analysis-smartcn-9.4.2.jar.sha1 | 1 -
.../lucene-analysis-smartcn-9.5.0.jar.sha1 | 1 +
.../lucene-analysis-stempel-9.4.2.jar.sha1 | 1 -
.../lucene-analysis-stempel-9.5.0.jar.sha1 | 1 +
.../licenses/lucene-backward-codecs-9.4.2.jar.sha1 | 1 -
.../licenses/lucene-backward-codecs-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-classification-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-classification-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-codecs-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-codecs-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-core-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-core-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-expressions-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-expressions-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-grouping-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-grouping-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-highlighter-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-highlighter-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-join-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-join-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-memory-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-memory-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-misc-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-misc-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-queries-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-queries-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-queryparser-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-queryparser-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-sandbox-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-sandbox-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-spatial-extras-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-spatial-extras-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-spatial3d-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-spatial3d-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-suggest-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-suggest-9.5.0.jar.sha1 | 1 +
solr/licenses/lucene-test-framework-9.4.2.jar.sha1 | 1 -
solr/licenses/lucene-test-framework-9.5.0.jar.sha1 | 1 +
...ExtractNamedEntitiesUpdateProcessorFactory.java | 32 ++++++------
.../solr/configsets/_default/conf/solrconfig.xml | 2 +-
.../conf/solrconfig.xml | 2 +-
versions.lock | 54 ++++++++++----------
versions.props | 2 +-
82 files changed, 195 insertions(+), 208 deletions(-)
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 5a3603ed9e3..3ffb07d6bf4 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -67,6 +67,8 @@ Dependency Upgrades
---------------------
* PR#1494: Upgrade forbiddenapis to 3.5 (Uwe Schindler)
+* SOLR-16642: Upgrade to Lucene 9.5.0 (Vinayak Hegde, David Smiley)
+
Other Changes
---------------------
@@ -290,7 +292,7 @@ Bug Fixes
* SOLR-16679: Fix solr.jetty.ssl.verifyClientHostName logging (Kevin Risden)
-* SOLR-16682: MoreLikeThis Component fails with SyntaxError: Cannot parse if document terms contains symbols from query parser syntax
+* SOLR-16682: MoreLikeThis Component fails with SyntaxError: Cannot parse if document terms contains symbols from query parser syntax
(Mikhail Khludnev)
* SOLR-16656: rid parameter missing from query logs (Alex Deparvu)
diff --git a/solr/bin/solr b/solr/bin/solr
index 45a844995ea..6a3ed2933ba 100644
--- a/solr/bin/solr
+++ b/solr/bin/solr
@@ -2275,12 +2275,6 @@ function start_solr() {
echo "Java $JAVA_VER_NUM detected. Enabled workaround for SOLR-16463"
fi
- # Added --enable-preview for JDK 19 to enable MemorySegment support in MMapDirectory, see https://issues.apache.org/jira/browse/SOLR-16500
- if [[ "$JAVA_VER_NUM" -eq "19" ]] ; then
- SOLR_OPTS+=("--enable-preview")
- echo "Java $JAVA_VER_NUM detected. Added --enable-preview to enable MemorySegment support in MMapDirectory. See SOLR-16500"
- fi
-
SOLR_START_OPTS=('-server' "${JAVA_MEM_OPTS[@]}" "${GC_TUNE_ARR[@]}" "${GC_LOG_OPTS[@]}" "${IP_ACL_OPTS[@]}" \
"${REMOTE_JMX_OPTS[@]}" "${CLOUD_MODE_OPTS[@]}" ${SOLR_LOG_LEVEL_OPT:-} -Dsolr.log.dir="$SOLR_LOGS_DIR" \
"-Djetty.port=$SOLR_PORT" "-DSTOP.PORT=$stop_port" "-DSTOP.KEY=$STOP_KEY" \
diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd
index 77b1b2263ab..6a025dab2c6 100755
--- a/solr/bin/solr.cmd
+++ b/solr/bin/solr.cmd
@@ -1280,13 +1280,6 @@ if !JAVA_MAJOR_VERSION! GEQ 17 (
echo Java %JAVA_MAJOR_VERSION% detected. Enabled workaround for SOLR-16463
)
-REM Added --enable-preview for JDK 19 to enable MemorySegment support in MMapDirectory. See https://issues.apache.org/jira/browse/SOLR-16500
-
-if !JAVA_MAJOR_VERSION! EQU 19 (
- set SOLR_OPTS=%SOLR_OPTS% --enable-preview
- echo Java $JAVA_VER_NUM detected. Added --enable-preview to enable MemorySegment support in MMapDirectory. See SOLR-16500
-)
-
if !JAVA_MAJOR_VERSION! GEQ 9 if NOT "%JAVA_VENDOR%" == "OpenJ9" (
IF NOT "%GC_LOG_OPTS%"=="" (
echo ERROR: On Java 9 you cannot set GC_LOG_OPTS, only default GC logging is available. Exiting
diff --git a/solr/core/src/java/org/apache/solr/core/MMapDirectoryFactory.java b/solr/core/src/java/org/apache/solr/core/MMapDirectoryFactory.java
index b2b40297967..30735cc696d 100644
--- a/solr/core/src/java/org/apache/solr/core/MMapDirectoryFactory.java
+++ b/solr/core/src/java/org/apache/solr/core/MMapDirectoryFactory.java
@@ -42,7 +42,6 @@ import org.slf4j.LoggerFactory;
*/
public class MMapDirectoryFactory extends StandardDirectoryFactory {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
- boolean unmapHack;
boolean preload;
private long maxChunk;
@@ -54,7 +53,12 @@ public class MMapDirectoryFactory extends StandardDirectoryFactory {
if (maxChunk <= 0) {
throw new IllegalArgumentException("maxChunk must be greater than 0");
}
- unmapHack = params.getBool("unmap", true);
+ if (params.get("unmap") != null) {
+ log.warn(
+ "It is no longer possible to configure unmapping of index files on DirectoryFactory level in solrconfig.xml.");
+ log.warn(
+ "To disable unmapping, pass -Dorg.apache.lucene.store.MMapDirectory.enableUnmapHack=false on Solr's command line.");
+ }
preload = params.getBool("preload", false); // default turn-off
}
@@ -62,11 +66,6 @@ public class MMapDirectoryFactory extends StandardDirectoryFactory {
protected Directory create(String path, LockFactory lockFactory, DirContext dirContext)
throws IOException {
MMapDirectory mapDirectory = new MMapDirectory(Path.of(path), lockFactory, maxChunk);
- try {
- mapDirectory.setUseUnmap(unmapHack);
- } catch (IllegalArgumentException e) {
- log.warn("Unmap not supported on this JVM, continuing on without setting unmap", e);
- }
mapDirectory.setPreload(preload);
return mapDirectory;
}
diff --git a/solr/core/src/java/org/apache/solr/core/SchemaCodecFactory.java b/solr/core/src/java/org/apache/solr/core/SchemaCodecFactory.java
index 45e8332a0b5..8615e0a32ef 100644
--- a/solr/core/src/java/org/apache/solr/core/SchemaCodecFactory.java
+++ b/solr/core/src/java/org/apache/solr/core/SchemaCodecFactory.java
@@ -23,9 +23,9 @@ import org.apache.lucene.codecs.Codec;
import org.apache.lucene.codecs.DocValuesFormat;
import org.apache.lucene.codecs.KnnVectorsFormat;
import org.apache.lucene.codecs.PostingsFormat;
-import org.apache.lucene.codecs.lucene94.Lucene94Codec;
-import org.apache.lucene.codecs.lucene94.Lucene94Codec.Mode;
-import org.apache.lucene.codecs.lucene94.Lucene94HnswVectorsFormat;
+import org.apache.lucene.codecs.lucene95.Lucene95Codec;
+import org.apache.lucene.codecs.lucene95.Lucene95Codec.Mode;
+import org.apache.lucene.codecs.lucene95.Lucene95HnswVectorsFormat;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.SolrException.ErrorCode;
import org.apache.solr.common.util.NamedList;
@@ -92,7 +92,7 @@ public class SchemaCodecFactory extends CodecFactory implements SolrCoreAware {
log.debug("Using default compressionMode: {}", compressionMode);
}
codec =
- new Lucene94Codec(compressionMode) {
+ new Lucene95Codec(compressionMode) {
@Override
public PostingsFormat getPostingsFormatForField(String field) {
final SchemaField schemaField = core.getLatestSchema().getFieldOrNull(field);
@@ -127,7 +127,7 @@ public class SchemaCodecFactory extends CodecFactory implements SolrCoreAware {
if (DenseVectorField.HNSW_ALGORITHM.equals(knnAlgorithm)) {
int maxConn = vectorType.getHnswMaxConn();
int beamWidth = vectorType.getHnswBeamWidth();
- return new Lucene94HnswVectorsFormat(maxConn, beamWidth);
+ return new Lucene95HnswVectorsFormat(maxConn, beamWidth);
} else {
throw new SolrException(
ErrorCode.SERVER_ERROR, knnAlgorithm + " KNN algorithm is not supported");
diff --git a/solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java b/solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java
index 31c65babb28..155ba9ea075 100644
--- a/solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/MoreLikeThisHandler.java
@@ -291,7 +291,7 @@ public class MoreLikeThisHandler extends RequestHandlerBase {
final boolean needDocSet;
Map<String, Float> boostFields;
- public MoreLikeThisHelper(SolrParams params, SolrIndexSearcher searcher) {
+ public MoreLikeThisHelper(SolrParams params, SolrIndexSearcher searcher) throws IOException {
this.searcher = searcher;
this.reader = searcher.getIndexReader();
this.uniqueKeyField = searcher.getSchema().getUniqueKeyField();
diff --git a/solr/core/src/java/org/apache/solr/handler/admin/IndexSizeEstimator.java b/solr/core/src/java/org/apache/solr/handler/admin/IndexSizeEstimator.java
index 2296d7ed193..b4f222a7a49 100644
--- a/solr/core/src/java/org/apache/solr/handler/admin/IndexSizeEstimator.java
+++ b/solr/core/src/java/org/apache/solr/handler/admin/IndexSizeEstimator.java
@@ -602,7 +602,7 @@ public class IndexSizeEstimator {
if (liveDocs != null && !liveDocs.get(docId)) {
continue;
}
- mergeInstance.visitDocument(docId, visitor);
+ mergeInstance.document(docId, visitor);
}
if (mergeInstance != storedFieldsReader) {
mergeInstance.close();
diff --git a/solr/core/src/java/org/apache/solr/index/SlowCompositeReaderWrapper.java b/solr/core/src/java/org/apache/solr/index/SlowCompositeReaderWrapper.java
index 68197308ca8..b066ba373fd 100644
--- a/solr/core/src/java/org/apache/solr/index/SlowCompositeReaderWrapper.java
+++ b/solr/core/src/java/org/apache/solr/index/SlowCompositeReaderWrapper.java
@@ -22,6 +22,7 @@ import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import org.apache.lucene.index.BinaryDocValues;
+import org.apache.lucene.index.ByteVectorValues;
import org.apache.lucene.index.CompositeReader;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.DocValues;
@@ -29,6 +30,7 @@ import org.apache.lucene.index.DocValuesType;
import org.apache.lucene.index.FieldInfo;
import org.apache.lucene.index.FieldInfos;
import org.apache.lucene.index.Fields;
+import org.apache.lucene.index.FloatVectorValues;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.LeafMetaData;
import org.apache.lucene.index.LeafReader;
@@ -45,8 +47,9 @@ import org.apache.lucene.index.SortedDocValues;
import org.apache.lucene.index.SortedNumericDocValues;
import org.apache.lucene.index.SortedSetDocValues;
import org.apache.lucene.index.StoredFieldVisitor;
+import org.apache.lucene.index.StoredFields;
+import org.apache.lucene.index.TermVectors;
import org.apache.lucene.index.Terms;
-import org.apache.lucene.index.VectorValues;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.util.Bits;
import org.apache.lucene.util.Version;
@@ -73,8 +76,6 @@ public final class SlowCompositeReaderWrapper extends LeafReader {
// also have a cached FieldInfos instance so this is consistent. SOLR-12878
private final FieldInfos fieldInfos;
- final Map<String, Terms> cachedTerms = new ConcurrentHashMap<>();
-
// TODO: this could really be a weak map somewhere else on the coreCacheKey,
// but do we really need to optimize slow-wrapper any more?
final Map<String, OrdinalMap> cachedOrdMaps = new ConcurrentHashMap<>();
@@ -136,23 +137,7 @@ public final class SlowCompositeReaderWrapper extends LeafReader {
@Override
public Terms terms(String field) throws IOException {
ensureOpen();
- try {
- return cachedTerms.computeIfAbsent(
- field,
- f -> {
- try {
- return MultiTerms.getTerms(in, f);
- } catch (IOException e) {
- // yuck! ...sigh... checked exceptions with built-in lambdas are a pain
- throw new RuntimeException("unwrapMe", e);
- }
- });
- } catch (RuntimeException e) {
- if (e.getMessage().equals("unwrapMe") && e.getCause() instanceof IOException) {
- throw (IOException) e.getCause();
- }
- throw e;
- }
+ return MultiTerms.getTerms(in, field);
}
@Override
@@ -328,6 +313,18 @@ public final class SlowCompositeReaderWrapper extends LeafReader {
return in.getTermVectors(docID);
}
+ @Override
+ public TermVectors termVectors() throws IOException {
+ ensureOpen();
+ return in.termVectors();
+ }
+
+ @Override
+ public StoredFields storedFields() throws IOException {
+ ensureOpen();
+ return in.storedFields();
+ }
+
@Override
public int numDocs() {
// Don't call ensureOpen() here (it could affect performance)
@@ -355,19 +352,31 @@ public final class SlowCompositeReaderWrapper extends LeafReader {
@Override
public PointValues getPointValues(String field) {
ensureOpen();
- return null; // because not supported. Throw UOE?
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public FloatVectorValues getFloatVectorValues(String field) {
+ ensureOpen();
+ throw new UnsupportedOperationException();
}
@Override
- public VectorValues getVectorValues(String field) {
+ public ByteVectorValues getByteVectorValues(String field) {
ensureOpen();
- return VectorValues.EMPTY;
+ throw new UnsupportedOperationException();
}
@Override
public TopDocs searchNearestVectors(
String field, float[] target, int k, Bits acceptDocs, int visitedLimit) throws IOException {
- return null;
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public TopDocs searchNearestVectors(
+ String field, byte[] target, int k, Bits acceptDocs, int visitedLimit) throws IOException {
+ throw new UnsupportedOperationException();
}
@Override
diff --git a/solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java b/solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java
index c0f641d52ed..9f3f393bbf0 100644
--- a/solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java
+++ b/solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java
@@ -624,23 +624,24 @@ public abstract class SolrQueryParserBase extends QueryBuilder {
}
@Override
- protected Query newSynonymQuery(TermAndBoost[] terms) {
+ protected Query newSynonymQuery(String field, TermAndBoost[] terms) {
switch (synonymQueryStyle) {
case PICK_BEST:
List<Query> currPosnClauses = new ArrayList<>(terms.length);
for (TermAndBoost term : terms) {
- currPosnClauses.add(newTermQuery(term.term, term.boost));
+ currPosnClauses.add(newTermQuery(new Term(field, term.term), term.boost));
}
DisjunctionMaxQuery dm = new DisjunctionMaxQuery(currPosnClauses, 0.0f);
return dm;
case AS_DISTINCT_TERMS:
BooleanQuery.Builder builder = new BooleanQuery.Builder();
for (TermAndBoost term : terms) {
- builder.add(newTermQuery(term.term, term.boost), BooleanClause.Occur.SHOULD);
+ builder.add(
+ newTermQuery(new Term(field, term.term), term.boost), BooleanClause.Occur.SHOULD);
}
return builder.build();
case AS_SAME_TERM:
- return super.newSynonymQuery(terms);
+ return super.newSynonymQuery(field, terms);
default:
throw new AssertionError(
"unrecognized synonymQueryStyle passed when creating newSynonymQuery");
diff --git a/solr/core/src/java/org/apache/solr/schema/DenseVectorField.java b/solr/core/src/java/org/apache/solr/schema/DenseVectorField.java
index e41bc161dda..c59b0ead0bb 100644
--- a/solr/core/src/java/org/apache/solr/schema/DenseVectorField.java
+++ b/solr/core/src/java/org/apache/solr/schema/DenseVectorField.java
@@ -17,8 +17,8 @@
package org.apache.solr.schema;
import static java.util.Optional.ofNullable;
-import static org.apache.lucene.codecs.lucene94.Lucene94HnswVectorsFormat.DEFAULT_BEAM_WIDTH;
-import static org.apache.lucene.codecs.lucene94.Lucene94HnswVectorsFormat.DEFAULT_MAX_CONN;
+import static org.apache.lucene.codecs.lucene95.Lucene95HnswVectorsFormat.DEFAULT_BEAM_WIDTH;
+import static org.apache.lucene.codecs.lucene95.Lucene95HnswVectorsFormat.DEFAULT_MAX_CONN;
import java.util.ArrayList;
import java.util.List;
diff --git a/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java b/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
index 7d5c8e705c2..b12db8b8772 100644
--- a/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
+++ b/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
@@ -465,19 +465,7 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable, SolrI
}
public CollectionStatistics localCollectionStatistics(String field) throws IOException {
- // Could call super.collectionStatistics(field); but we can use a cached MultiTerms
- assert field != null;
- // SlowAtomicReader has a cache of MultiTerms
- Terms terms = getSlowAtomicReader().terms(field);
- if (terms == null) {
- return null;
- }
- return new CollectionStatistics(
- field,
- reader.maxDoc(),
- terms.getDocCount(),
- terms.getSumTotalTermFreq(),
- terms.getSumDocFreq());
+ return super.collectionStatistics(field);
}
public boolean isCachingEnabled() {
diff --git a/solr/core/src/java/org/apache/solr/search/SolrQueryTimeoutImpl.java b/solr/core/src/java/org/apache/solr/search/SolrQueryTimeoutImpl.java
index 699b656793a..bc096ae2ef4 100644
--- a/solr/core/src/java/org/apache/solr/search/SolrQueryTimeoutImpl.java
+++ b/solr/core/src/java/org/apache/solr/search/SolrQueryTimeoutImpl.java
@@ -45,7 +45,6 @@ public class SolrQueryTimeoutImpl implements QueryTimeout {
return timeoutAt.get();
}
- @Override
public boolean isTimeoutEnabled() {
return getTimeoutAtNs() != null;
}
diff --git a/solr/core/src/java/org/apache/solr/spelling/suggest/DictionaryFactory.java b/solr/core/src/java/org/apache/solr/spelling/suggest/DictionaryFactory.java
index d8f243bda8d..f45012bf1cf 100644
--- a/solr/core/src/java/org/apache/solr/spelling/suggest/DictionaryFactory.java
+++ b/solr/core/src/java/org/apache/solr/spelling/suggest/DictionaryFactory.java
@@ -16,6 +16,7 @@
*/
package org.apache.solr.spelling.suggest;
+import java.io.IOException;
import org.apache.lucene.search.spell.Dictionary;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.core.SolrCore;
@@ -41,5 +42,5 @@ public abstract class DictionaryFactory {
* Create a Dictionary using options in <code>core</code> and optionally uses <code>searcher
* </code>, in case of index based dictionaries
*/
- public abstract Dictionary create(SolrCore core, SolrIndexSearcher searcher);
+ public abstract Dictionary create(SolrCore core, SolrIndexSearcher searcher) throws IOException;
}
diff --git a/solr/core/src/java/org/apache/solr/spelling/suggest/DocumentDictionaryFactory.java b/solr/core/src/java/org/apache/solr/spelling/suggest/DocumentDictionaryFactory.java
index 4e45688dacc..42b70bc063c 100644
--- a/solr/core/src/java/org/apache/solr/spelling/suggest/DocumentDictionaryFactory.java
+++ b/solr/core/src/java/org/apache/solr/spelling/suggest/DocumentDictionaryFactory.java
@@ -16,6 +16,7 @@
*/
package org.apache.solr.spelling.suggest;
+import java.io.IOException;
import org.apache.lucene.search.spell.Dictionary;
import org.apache.lucene.search.suggest.DocumentDictionary;
import org.apache.solr.core.SolrCore;
@@ -33,7 +34,7 @@ public class DocumentDictionaryFactory extends DictionaryFactory {
public static final String CONTEXT_FIELD = "contextField";
@Override
- public Dictionary create(SolrCore core, SolrIndexSearcher searcher) {
+ public Dictionary create(SolrCore core, SolrIndexSearcher searcher) throws IOException {
if (params == null) {
// should not happen; implies setParams was not called
throw new IllegalStateException("Value of params not set");
diff --git a/solr/core/src/java/org/apache/solr/spelling/suggest/DocumentExpressionDictionaryFactory.java b/solr/core/src/java/org/apache/solr/spelling/suggest/DocumentExpressionDictionaryFactory.java
index a5ce5f11aa1..2b943eb653c 100644
--- a/solr/core/src/java/org/apache/solr/spelling/suggest/DocumentExpressionDictionaryFactory.java
+++ b/solr/core/src/java/org/apache/solr/spelling/suggest/DocumentExpressionDictionaryFactory.java
@@ -16,6 +16,7 @@
*/
package org.apache.solr.spelling.suggest;
+import java.io.IOException;
import java.text.ParseException;
import java.util.HashSet;
import java.util.Set;
@@ -46,7 +47,7 @@ public class DocumentExpressionDictionaryFactory extends DictionaryFactory {
public static final String SORT_FIELD = "sortField";
@Override
- public Dictionary create(SolrCore core, SolrIndexSearcher searcher) {
+ public Dictionary create(SolrCore core, SolrIndexSearcher searcher) throws IOException {
if (params == null) {
// should not happen; implies setParams was not called
throw new IllegalStateException("Value of params not set");
diff --git a/solr/core/src/java/org/apache/solr/update/processor/ClassificationUpdateProcessor.java b/solr/core/src/java/org/apache/solr/update/processor/ClassificationUpdateProcessor.java
index b85f4863d22..f7bc7fa8c1d 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/ClassificationUpdateProcessor.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/ClassificationUpdateProcessor.java
@@ -29,6 +29,7 @@ import org.apache.lucene.classification.document.SimpleNaiveBayesDocumentClassif
import org.apache.lucene.document.Document;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.util.BytesRef;
+import org.apache.solr.common.SolrException;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.schema.IndexSchema;
import org.apache.solr.schema.SchemaField;
@@ -77,17 +78,24 @@ class ClassificationUpdateProcessor extends UpdateRequestProcessor {
}
switch (classificationAlgorithm) {
case KNN:
- classifier =
- new KNearestNeighborDocumentClassifier(
- indexReader,
- null,
- classificationParams.getTrainingFilterQuery(),
- classificationParams.getK(),
- classificationParams.getMinDf(),
- classificationParams.getMinTf(),
- trainingClassField,
- field2analyzer,
- inputFieldNamesWithBoost);
+ try {
+ classifier =
+ new KNearestNeighborDocumentClassifier(
+ indexReader,
+ null,
+ classificationParams.getTrainingFilterQuery(),
+ classificationParams.getK(),
+ classificationParams.getMinDf(),
+ classificationParams.getMinTf(),
+ trainingClassField,
+ field2analyzer,
+ inputFieldNamesWithBoost);
+ } catch (IOException e) {
+ throw new SolrException(
+ SolrException.ErrorCode.SERVER_ERROR,
+ "IOException occurred while instantiating KNearestNeighborDocumentClassifier",
+ e);
+ }
break;
case BAYES:
classifier =
diff --git a/solr/core/src/test/org/apache/solr/core/TestCodecSupport.java b/solr/core/src/test/org/apache/solr/core/TestCodecSupport.java
index b91e7c83d85..6681af15c12 100644
--- a/solr/core/src/test/org/apache/solr/core/TestCodecSupport.java
+++ b/solr/core/src/test/org/apache/solr/core/TestCodecSupport.java
@@ -21,7 +21,7 @@ import static org.apache.lucene.codecs.lucene90.Lucene90StoredFieldsFormat.MODE_
import java.io.IOException;
import java.util.Map;
import org.apache.lucene.codecs.Codec;
-import org.apache.lucene.codecs.lucene94.Lucene94Codec.Mode;
+import org.apache.lucene.codecs.lucene95.Lucene95Codec.Mode;
import org.apache.lucene.codecs.perfield.PerFieldDocValuesFormat;
import org.apache.lucene.codecs.perfield.PerFieldPostingsFormat;
import org.apache.lucene.index.SegmentInfo;
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/IndexSizeEstimatorTest.java b/solr/core/src/test/org/apache/solr/handler/admin/IndexSizeEstimatorTest.java
index 6f5c156ce94..e175497aa36 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/IndexSizeEstimatorTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/IndexSizeEstimatorTest.java
@@ -149,7 +149,7 @@ public class IndexSizeEstimatorTest extends SolrCloudTestCase {
if (liveDocs != null && !liveDocs.get(docId)) {
continue;
}
- storedFieldsReader.visitDocument(docId, visitor);
+ storedFieldsReader.document(docId, visitor);
}
}
} finally {
diff --git a/solr/core/src/test/org/apache/solr/index/TestSlowCompositeReaderWrapper.java b/solr/core/src/test/org/apache/solr/index/TestSlowCompositeReaderWrapper.java
index 9862ac06ddd..bc6b699f1bf 100644
--- a/solr/core/src/test/org/apache/solr/index/TestSlowCompositeReaderWrapper.java
+++ b/solr/core/src/test/org/apache/solr/index/TestSlowCompositeReaderWrapper.java
@@ -21,16 +21,13 @@ import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.lucene.document.Document;
-import org.apache.lucene.document.Field;
import org.apache.lucene.document.SortedDocValuesField;
import org.apache.lucene.document.SortedSetDocValuesField;
-import org.apache.lucene.document.TextField;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.LeafReader;
import org.apache.lucene.index.MultiDocValues.MultiSortedDocValues;
import org.apache.lucene.index.MultiDocValues.MultiSortedSetDocValues;
-import org.apache.lucene.index.MultiTerms;
import org.apache.lucene.index.NoMergePolicy;
import org.apache.lucene.store.Directory;
import org.apache.lucene.tests.index.RandomIndexWriter;
@@ -129,31 +126,4 @@ public class TestSlowCompositeReaderWrapper extends SolrTestCase {
w.close();
dir.close();
}
-
- public void testTermsAreCached() throws IOException {
- Directory dir = newDirectory();
- RandomIndexWriter w =
- new RandomIndexWriter(
- random(), dir, newIndexWriterConfig().setMergePolicy(NoMergePolicy.INSTANCE));
- Document doc = new Document();
- doc.add(new TextField("text", "hello world", Field.Store.NO));
- w.addDocument(doc);
- w.getReader().close();
- doc = new Document();
- doc.add(new TextField("text", "cruel world", Field.Store.NO));
- w.addDocument(doc);
-
- IndexReader reader = w.getReader();
- assertTrue(reader.leaves().size() > 1);
- SlowCompositeReaderWrapper slowWrapper =
- (SlowCompositeReaderWrapper) SlowCompositeReaderWrapper.wrap(reader);
- assertEquals(0, slowWrapper.cachedTerms.size());
- assertEquals(MultiTerms.class, slowWrapper.terms("text").getClass());
- assertEquals(1, slowWrapper.cachedTerms.size());
- assertNull(slowWrapper.terms("bogusField"));
- assertEquals(1, slowWrapper.cachedTerms.size()); // bogus field isn't cached
- reader.close();
- w.close();
- dir.close();
- }
}
diff --git a/solr/core/src/test/org/apache/solr/search/TestComplexPhraseQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/TestComplexPhraseQParserPlugin.java
index 84d0060d9a8..42d0eae5f65 100644
--- a/solr/core/src/test/org/apache/solr/search/TestComplexPhraseQParserPlugin.java
+++ b/solr/core/src/test/org/apache/solr/search/TestComplexPhraseQParserPlugin.java
@@ -211,6 +211,7 @@ public class TestComplexPhraseQParserPlugin extends SolrTestCaseJ4 {
"//lst[@name='highlighting']/lst[@name='2']",
"//lst[@name='2']/arr[@name='name']/str[.='<em>johathon</em> <em>smith</em> smith johathon']");
+ /* no longer supported since Lucene 9.5 but that's okay!
args.put(HighlightParams.USE_PHRASE_HIGHLIGHTER, Boolean.FALSE.toString());
sumLRF = h.getRequestFactory("", 0, 200, args);
assertQ(
@@ -220,18 +221,17 @@ public class TestComplexPhraseQParserPlugin extends SolrTestCaseJ4 {
"//lst[@name='1']/arr[@name='name']/str[.='<em>john</em> <em>smith</em> <em>smith</em> <em>john</em>']",
"//lst[@name='highlighting']/lst[@name='2']",
"//lst[@name='2']/arr[@name='name']/str[.='<em>johathon</em> <em>smith</em> <em>smith</em> <em>johathon</em>']");
-
- /*
- assertQ("Highlight Plain Prefix Query Test",
- sumLRF.makeRequest("name:jo*"),
- "//lst[@name='highlighting']/lst[@name='1']",
- "//lst[@name='1']/arr[@name='name']/str[.='<em>john</em> smith smith <em>john</em>']",
- "//lst[@name='highlighting']/lst[@name='2']",
- "//lst[@name='2']/arr[@name='name']/str[.='<em>johathon</em> smith smith <em>johathon</em>']",
- "//lst[@name='highlighting']/lst[@name='3']",
- "//lst[@name='3']/arr[@name='name']/str[.='<em>john</em> percival smith']"
- );
*/
+
+ assertQ(
+ "Highlight Plain Prefix Query Test",
+ sumLRF.makeRequest("name:jo*"),
+ "//lst[@name='highlighting']/lst[@name='1']",
+ "//lst[@name='1']/arr[@name='name']/str[.='<em>john</em> smith smith <em>john</em>']",
+ "//lst[@name='highlighting']/lst[@name='2']",
+ "//lst[@name='2']/arr[@name='name']/str[.='<em>johathon</em> smith smith <em>johathon</em>']",
+ "//lst[@name='highlighting']/lst[@name='3']",
+ "//lst[@name='3']/arr[@name='name']/str[.='<em>john</em> percival smith']");
}
@Test
diff --git a/solr/core/src/test/org/apache/solr/search/TestDocSet.java b/solr/core/src/test/org/apache/solr/search/TestDocSet.java
index 273cadf986f..e4729c33a92 100644
--- a/solr/core/src/test/org/apache/solr/search/TestDocSet.java
+++ b/solr/core/src/test/org/apache/solr/search/TestDocSet.java
@@ -23,8 +23,10 @@ import java.util.Random;
import java.util.function.Supplier;
import java.util.function.ToIntFunction;
import org.apache.lucene.index.BinaryDocValues;
+import org.apache.lucene.index.ByteVectorValues;
import org.apache.lucene.index.FieldInfos;
import org.apache.lucene.index.Fields;
+import org.apache.lucene.index.FloatVectorValues;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.IndexReaderContext;
import org.apache.lucene.index.LeafMetaData;
@@ -37,8 +39,9 @@ import org.apache.lucene.index.SortedDocValues;
import org.apache.lucene.index.SortedNumericDocValues;
import org.apache.lucene.index.SortedSetDocValues;
import org.apache.lucene.index.StoredFieldVisitor;
+import org.apache.lucene.index.StoredFields;
+import org.apache.lucene.index.TermVectors;
import org.apache.lucene.index.Terms;
-import org.apache.lucene.index.VectorValues;
import org.apache.lucene.search.DocIdSet;
import org.apache.lucene.search.DocIdSetIterator;
import org.apache.lucene.search.TopDocs;
@@ -304,6 +307,11 @@ public class TestDocSet extends SolrTestCase {
return null;
}
+ @Override
+ public TermVectors termVectors() {
+ return null;
+ }
+
@Override
public int numDocs() {
return maxDoc;
@@ -360,7 +368,17 @@ public class TestDocSet extends SolrTestCase {
}
@Override
- public VectorValues getVectorValues(String field) {
+ public FloatVectorValues getFloatVectorValues(String field) {
+ return null;
+ }
+
+ @Override
+ public ByteVectorValues getByteVectorValues(String field) {
+ return null;
+ }
+
+ @Override
+ public StoredFields storedFields() {
return null;
}
@@ -371,6 +389,12 @@ public class TestDocSet extends SolrTestCase {
return null;
}
+ @Override
+ public TopDocs searchNearestVectors(
+ String field, byte[] target, int k, Bits acceptDoc, int visitedLimits) {
+ return null;
+ }
+
@Override
protected void doClose() {}
diff --git a/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdateProcessorFactoryTest.java b/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdateProcessorFactoryTest.java
index 11ae41b2985..86749dac8a8 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdateProcessorFactoryTest.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdateProcessorFactoryTest.java
@@ -238,7 +238,7 @@ public class AtomicUpdateProcessorFactoryTest extends SolrTestCaseJ4 {
}
private UpdateRequestProcessor createRunUpdateProcessor(
- SolrQueryRequest req, SolrQueryResponse rsp) {
+ SolrQueryRequest req, SolrQueryResponse rsp) throws IOException {
return new RunUpdateProcessorFactory().getInstance(req, rsp, null);
}
diff --git a/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java b/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java
index fea4262d598..0ba7a4f96e2 100644
--- a/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java
+++ b/solr/core/src/test/org/apache/solr/update/processor/UpdateRequestProcessorFactoryTest.java
@@ -18,6 +18,7 @@ package org.apache.solr.update.processor;
import static org.apache.solr.update.processor.DistributingUpdateProcessorFactory.DISTRIB_UPDATE_PARAM;
+import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.util.ArrayList;
import java.util.Arrays;
@@ -85,7 +86,7 @@ public class UpdateRequestProcessorFactoryTest extends SolrTestCaseJ4 {
assertEquals("{name={n8=88, n9=99}}", link.args.toString());
}
- public void testUpdateDistribChainSkipping() {
+ public void testUpdateDistribChainSkipping() throws IOException {
// a key part of this test is verifying that LogUpdateProcessor is found in all chains because
// it is a @RunAlways processor -- but in order for that to work, we have to sanity check that
diff --git a/solr/licenses/antlr4-runtime-4.11.1.jar.sha1 b/solr/licenses/antlr4-runtime-4.11.1.jar.sha1
new file mode 100644
index 00000000000..73976600b73
--- /dev/null
+++ b/solr/licenses/antlr4-runtime-4.11.1.jar.sha1
@@ -0,0 +1 @@
+069214c1de1960040729702eb58deac8827135e7
diff --git a/solr/licenses/antlr4-runtime-4.5.1-1.jar.sha1 b/solr/licenses/antlr4-runtime-4.5.1-1.jar.sha1
deleted file mode 100644
index f15e50069ba..00000000000
--- a/solr/licenses/antlr4-runtime-4.5.1-1.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-66144204f9d6d7d3f3f775622c2dd7e9bd511d97
diff --git a/solr/licenses/lucene-analysis-common-9.4.2.jar.sha1 b/solr/licenses/lucene-analysis-common-9.4.2.jar.sha1
deleted file mode 100644
index 275136a6c55..00000000000
--- a/solr/licenses/lucene-analysis-common-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-fc0c95d5bdd0f604ffe165f6eb4db82621455ebe
diff --git a/solr/licenses/lucene-analysis-common-9.5.0.jar.sha1 b/solr/licenses/lucene-analysis-common-9.5.0.jar.sha1
new file mode 100644
index 00000000000..7b0a28badb7
--- /dev/null
+++ b/solr/licenses/lucene-analysis-common-9.5.0.jar.sha1
@@ -0,0 +1 @@
+f68660102455a466f98cac0501723bed7e7c6407
diff --git a/solr/licenses/lucene-analysis-icu-9.4.2.jar.sha1 b/solr/licenses/lucene-analysis-icu-9.4.2.jar.sha1
deleted file mode 100644
index 7870d457164..00000000000
--- a/solr/licenses/lucene-analysis-icu-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-b0fb7442f6ddf9b8f8f806aa55d28ce03b4ba8ce
diff --git a/solr/licenses/lucene-analysis-icu-9.5.0.jar.sha1 b/solr/licenses/lucene-analysis-icu-9.5.0.jar.sha1
new file mode 100644
index 00000000000..70cb26d55f4
--- /dev/null
+++ b/solr/licenses/lucene-analysis-icu-9.5.0.jar.sha1
@@ -0,0 +1 @@
+11c816250e4ff106151fd8cb69e61ead4fb4a8dd
diff --git a/solr/licenses/lucene-analysis-kuromoji-9.4.2.jar.sha1 b/solr/licenses/lucene-analysis-kuromoji-9.4.2.jar.sha1
deleted file mode 100644
index b09d3d933fc..00000000000
--- a/solr/licenses/lucene-analysis-kuromoji-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-5151fa1b681ad12444b6a1d76f480bce7c6f207f
diff --git a/solr/licenses/lucene-analysis-kuromoji-9.5.0.jar.sha1 b/solr/licenses/lucene-analysis-kuromoji-9.5.0.jar.sha1
new file mode 100644
index 00000000000..ba22a97c499
--- /dev/null
+++ b/solr/licenses/lucene-analysis-kuromoji-9.5.0.jar.sha1
@@ -0,0 +1 @@
+4555fc64ce9d63c6c1f4983e816526f896606e9f
diff --git a/solr/licenses/lucene-analysis-morfologik-9.4.2.jar.sha1 b/solr/licenses/lucene-analysis-morfologik-9.4.2.jar.sha1
deleted file mode 100644
index 23429e420db..00000000000
--- a/solr/licenses/lucene-analysis-morfologik-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-01bd18ed02ea704f6ef475b61266d319bc6d22e7
diff --git a/solr/licenses/lucene-analysis-morfologik-9.5.0.jar.sha1 b/solr/licenses/lucene-analysis-morfologik-9.5.0.jar.sha1
new file mode 100644
index 00000000000..c7a4b22e692
--- /dev/null
+++ b/solr/licenses/lucene-analysis-morfologik-9.5.0.jar.sha1
@@ -0,0 +1 @@
+cb00cd193e2f927e6357cf33e0880034571ea528
diff --git a/solr/licenses/lucene-analysis-nori-9.4.2.jar.sha1 b/solr/licenses/lucene-analysis-nori-9.4.2.jar.sha1
deleted file mode 100644
index 4a051ae313b..00000000000
--- a/solr/licenses/lucene-analysis-nori-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-b5fb67c14b61b7afb4b3ba147e03bcb323cba7f8
diff --git a/solr/licenses/lucene-analysis-nori-9.5.0.jar.sha1 b/solr/licenses/lucene-analysis-nori-9.5.0.jar.sha1
new file mode 100644
index 00000000000..b395212c48d
--- /dev/null
+++ b/solr/licenses/lucene-analysis-nori-9.5.0.jar.sha1
@@ -0,0 +1 @@
+2fd55607da8adf8234169d9f4120119c05a8175c
diff --git a/solr/licenses/lucene-analysis-opennlp-9.4.2.jar.sha1 b/solr/licenses/lucene-analysis-opennlp-9.4.2.jar.sha1
deleted file mode 100644
index bf5bd6ae81c..00000000000
--- a/solr/licenses/lucene-analysis-opennlp-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-59b878224557a0164517383cb16dda9c8505e305
diff --git a/solr/licenses/lucene-analysis-opennlp-9.5.0.jar.sha1 b/solr/licenses/lucene-analysis-opennlp-9.5.0.jar.sha1
new file mode 100644
index 00000000000..8b3468a7e21
--- /dev/null
+++ b/solr/licenses/lucene-analysis-opennlp-9.5.0.jar.sha1
@@ -0,0 +1 @@
+e38f969b07b18c60a968b2a722388cb672d6bea9
diff --git a/solr/licenses/lucene-analysis-phonetic-9.4.2.jar.sha1 b/solr/licenses/lucene-analysis-phonetic-9.4.2.jar.sha1
deleted file mode 100644
index b2c010a2c5e..00000000000
--- a/solr/licenses/lucene-analysis-phonetic-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-bfbf3ba09dea738c38bd2eb1b468a33973cb808e
diff --git a/solr/licenses/lucene-analysis-phonetic-9.5.0.jar.sha1 b/solr/licenses/lucene-analysis-phonetic-9.5.0.jar.sha1
new file mode 100644
index 00000000000..6f94a49f99a
--- /dev/null
+++ b/solr/licenses/lucene-analysis-phonetic-9.5.0.jar.sha1
@@ -0,0 +1 @@
+c97163035f1d46249505d15fbdc427b6ae03549a
diff --git a/solr/licenses/lucene-analysis-smartcn-9.4.2.jar.sha1 b/solr/licenses/lucene-analysis-smartcn-9.4.2.jar.sha1
deleted file mode 100644
index 6bc4c2964b6..00000000000
--- a/solr/licenses/lucene-analysis-smartcn-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-47a9098cd851ae7f013f50885f97051e62aa7781
diff --git a/solr/licenses/lucene-analysis-smartcn-9.5.0.jar.sha1 b/solr/licenses/lucene-analysis-smartcn-9.5.0.jar.sha1
new file mode 100644
index 00000000000..b8d529ed0e9
--- /dev/null
+++ b/solr/licenses/lucene-analysis-smartcn-9.5.0.jar.sha1
@@ -0,0 +1 @@
+a08ae3e2212837c98d5e1174cf1a293a5c8c0373
diff --git a/solr/licenses/lucene-analysis-stempel-9.4.2.jar.sha1 b/solr/licenses/lucene-analysis-stempel-9.4.2.jar.sha1
deleted file mode 100644
index 6e91b8b8d1f..00000000000
--- a/solr/licenses/lucene-analysis-stempel-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-913f692e5592f813e1013102e9e06a34fc0d987b
diff --git a/solr/licenses/lucene-analysis-stempel-9.5.0.jar.sha1 b/solr/licenses/lucene-analysis-stempel-9.5.0.jar.sha1
new file mode 100644
index 00000000000..7dd5cb89e2d
--- /dev/null
+++ b/solr/licenses/lucene-analysis-stempel-9.5.0.jar.sha1
@@ -0,0 +1 @@
+483906d2ebad0ff910d52382c2f027b511788b58
diff --git a/solr/licenses/lucene-backward-codecs-9.4.2.jar.sha1 b/solr/licenses/lucene-backward-codecs-9.4.2.jar.sha1
deleted file mode 100644
index 1041a229f07..00000000000
--- a/solr/licenses/lucene-backward-codecs-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-5f82b75c01bb134aadcf549e2b0295a1417d71b4
diff --git a/solr/licenses/lucene-backward-codecs-9.5.0.jar.sha1 b/solr/licenses/lucene-backward-codecs-9.5.0.jar.sha1
new file mode 100644
index 00000000000..f02f7fabc96
--- /dev/null
+++ b/solr/licenses/lucene-backward-codecs-9.5.0.jar.sha1
@@ -0,0 +1 @@
+66be22239d5058b0b8a8aeba03dc047a276efafa
diff --git a/solr/licenses/lucene-classification-9.4.2.jar.sha1 b/solr/licenses/lucene-classification-9.4.2.jar.sha1
deleted file mode 100644
index 08d7825e904..00000000000
--- a/solr/licenses/lucene-classification-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-de275ff6ed779f34368da823428386f179d3c337
diff --git a/solr/licenses/lucene-classification-9.5.0.jar.sha1 b/solr/licenses/lucene-classification-9.5.0.jar.sha1
new file mode 100644
index 00000000000..5e223998a57
--- /dev/null
+++ b/solr/licenses/lucene-classification-9.5.0.jar.sha1
@@ -0,0 +1 @@
+5143516c82e0a0243c95eb17b456ab2dbd5bd99e
diff --git a/solr/licenses/lucene-codecs-9.4.2.jar.sha1 b/solr/licenses/lucene-codecs-9.4.2.jar.sha1
deleted file mode 100644
index 11c6526f6bf..00000000000
--- a/solr/licenses/lucene-codecs-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-468de55c642677e52e898443c5bf8546c7274985
diff --git a/solr/licenses/lucene-codecs-9.5.0.jar.sha1 b/solr/licenses/lucene-codecs-9.5.0.jar.sha1
new file mode 100644
index 00000000000..234cbd161df
--- /dev/null
+++ b/solr/licenses/lucene-codecs-9.5.0.jar.sha1
@@ -0,0 +1 @@
+07daa241bd4a3fa4cc2e1c7810b9f8d631877adf
diff --git a/solr/licenses/lucene-core-9.4.2.jar.sha1 b/solr/licenses/lucene-core-9.4.2.jar.sha1
deleted file mode 100644
index 469e66d8b0b..00000000000
--- a/solr/licenses/lucene-core-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-e9e7fe827e814839d8826d83cffdbd9d255150c4
diff --git a/solr/licenses/lucene-core-9.5.0.jar.sha1 b/solr/licenses/lucene-core-9.5.0.jar.sha1
new file mode 100644
index 00000000000..185470fb60a
--- /dev/null
+++ b/solr/licenses/lucene-core-9.5.0.jar.sha1
@@ -0,0 +1 @@
+bba4ba5d30e71a5f0017e45e8469db8cff8ad102
diff --git a/solr/licenses/lucene-expressions-9.4.2.jar.sha1 b/solr/licenses/lucene-expressions-9.4.2.jar.sha1
deleted file mode 100644
index 7631965e1dd..00000000000
--- a/solr/licenses/lucene-expressions-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-f433ede87302221b48703a890e5f5701cf1b021d
diff --git a/solr/licenses/lucene-expressions-9.5.0.jar.sha1 b/solr/licenses/lucene-expressions-9.5.0.jar.sha1
new file mode 100644
index 00000000000..f27ff319bf5
--- /dev/null
+++ b/solr/licenses/lucene-expressions-9.5.0.jar.sha1
@@ -0,0 +1 @@
+62f3d3630ecc14069d5c24b9693df5a2787f8202
diff --git a/solr/licenses/lucene-grouping-9.4.2.jar.sha1 b/solr/licenses/lucene-grouping-9.4.2.jar.sha1
deleted file mode 100644
index 23e68ebb352..00000000000
--- a/solr/licenses/lucene-grouping-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-2b8addf8bfe8515a2dcd5185cfe8dde493e98d2a
diff --git a/solr/licenses/lucene-grouping-9.5.0.jar.sha1 b/solr/licenses/lucene-grouping-9.5.0.jar.sha1
new file mode 100644
index 00000000000..6a7885000d9
--- /dev/null
+++ b/solr/licenses/lucene-grouping-9.5.0.jar.sha1
@@ -0,0 +1 @@
+b15fe0a55a82168c810d0447ec2e244d16d94f01
diff --git a/solr/licenses/lucene-highlighter-9.4.2.jar.sha1 b/solr/licenses/lucene-highlighter-9.4.2.jar.sha1
deleted file mode 100644
index 1525de500e6..00000000000
--- a/solr/licenses/lucene-highlighter-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-76eb0793f495045ef18b4324a47b94f50a1a163f
diff --git a/solr/licenses/lucene-highlighter-9.5.0.jar.sha1 b/solr/licenses/lucene-highlighter-9.5.0.jar.sha1
new file mode 100644
index 00000000000..7f7c0ad1f11
--- /dev/null
+++ b/solr/licenses/lucene-highlighter-9.5.0.jar.sha1
@@ -0,0 +1 @@
+8b5e3cea3370838bda1d730cf55176c24a763d2e
diff --git a/solr/licenses/lucene-join-9.4.2.jar.sha1 b/solr/licenses/lucene-join-9.4.2.jar.sha1
deleted file mode 100644
index 2670eae909b..00000000000
--- a/solr/licenses/lucene-join-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-18646fccd677af1ed8d56f3697aa693396d22704
diff --git a/solr/licenses/lucene-join-9.5.0.jar.sha1 b/solr/licenses/lucene-join-9.5.0.jar.sha1
new file mode 100644
index 00000000000..e23eeb7ca8b
--- /dev/null
+++ b/solr/licenses/lucene-join-9.5.0.jar.sha1
@@ -0,0 +1 @@
+85a4208614a5660297effce441883687b010073b
diff --git a/solr/licenses/lucene-memory-9.4.2.jar.sha1 b/solr/licenses/lucene-memory-9.4.2.jar.sha1
deleted file mode 100644
index 45e581f1972..00000000000
--- a/solr/licenses/lucene-memory-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-685522495dea97e493784aac1f414d218e3019df
diff --git a/solr/licenses/lucene-memory-9.5.0.jar.sha1 b/solr/licenses/lucene-memory-9.5.0.jar.sha1
new file mode 100644
index 00000000000..b55d14ad1e2
--- /dev/null
+++ b/solr/licenses/lucene-memory-9.5.0.jar.sha1
@@ -0,0 +1 @@
+d632e63d08837be715046c8ccb4fb804acd3d7e4
diff --git a/solr/licenses/lucene-misc-9.4.2.jar.sha1 b/solr/licenses/lucene-misc-9.4.2.jar.sha1
deleted file mode 100644
index c785c7ce8c0..00000000000
--- a/solr/licenses/lucene-misc-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-59f0ee89d9a06dd1c297d7d86981c39c87c51018
diff --git a/solr/licenses/lucene-misc-9.5.0.jar.sha1 b/solr/licenses/lucene-misc-9.5.0.jar.sha1
new file mode 100644
index 00000000000..ca449930409
--- /dev/null
+++ b/solr/licenses/lucene-misc-9.5.0.jar.sha1
@@ -0,0 +1 @@
+64773801b8ba8141f4256d22da598de40d6f3033
diff --git a/solr/licenses/lucene-queries-9.4.2.jar.sha1 b/solr/licenses/lucene-queries-9.4.2.jar.sha1
deleted file mode 100644
index 6b1617d6bd5..00000000000
--- a/solr/licenses/lucene-queries-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-d102a8c6cba1ff028a0127035565be005e78ef8e
diff --git a/solr/licenses/lucene-queries-9.5.0.jar.sha1 b/solr/licenses/lucene-queries-9.5.0.jar.sha1
new file mode 100644
index 00000000000..b62bb16e390
--- /dev/null
+++ b/solr/licenses/lucene-queries-9.5.0.jar.sha1
@@ -0,0 +1 @@
+ae7930fa0ea91198905d695a222ef7f09de1c2dd
diff --git a/solr/licenses/lucene-queryparser-9.4.2.jar.sha1 b/solr/licenses/lucene-queryparser-9.4.2.jar.sha1
deleted file mode 100644
index 4c8cec0edc2..00000000000
--- a/solr/licenses/lucene-queryparser-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-322aa2ca41f66c002b5d0ab1d21264d65ff5b9c5
diff --git a/solr/licenses/lucene-queryparser-9.5.0.jar.sha1 b/solr/licenses/lucene-queryparser-9.5.0.jar.sha1
new file mode 100644
index 00000000000..e26349bd605
--- /dev/null
+++ b/solr/licenses/lucene-queryparser-9.5.0.jar.sha1
@@ -0,0 +1 @@
+b3e3d9434bcfce242e242364c64eab0888d285e2
diff --git a/solr/licenses/lucene-sandbox-9.4.2.jar.sha1 b/solr/licenses/lucene-sandbox-9.4.2.jar.sha1
deleted file mode 100644
index 36c6d950646..00000000000
--- a/solr/licenses/lucene-sandbox-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-a45e07fd4b70f868115bab5de704181680be9f04
diff --git a/solr/licenses/lucene-sandbox-9.5.0.jar.sha1 b/solr/licenses/lucene-sandbox-9.5.0.jar.sha1
new file mode 100644
index 00000000000..c5966f8fadc
--- /dev/null
+++ b/solr/licenses/lucene-sandbox-9.5.0.jar.sha1
@@ -0,0 +1 @@
+408be287b0f421cf8afd655579a0cc65aba61b28
diff --git a/solr/licenses/lucene-spatial-extras-9.4.2.jar.sha1 b/solr/licenses/lucene-spatial-extras-9.4.2.jar.sha1
deleted file mode 100644
index a6bf174c996..00000000000
--- a/solr/licenses/lucene-spatial-extras-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-18bd925556054addda907bfd3334ab4b4cc9e258
diff --git a/solr/licenses/lucene-spatial-extras-9.5.0.jar.sha1 b/solr/licenses/lucene-spatial-extras-9.5.0.jar.sha1
new file mode 100644
index 00000000000..a63aae32e83
--- /dev/null
+++ b/solr/licenses/lucene-spatial-extras-9.5.0.jar.sha1
@@ -0,0 +1 @@
+4960c09365d20f024bf668f60d7c3b4e54f03750
diff --git a/solr/licenses/lucene-spatial3d-9.4.2.jar.sha1 b/solr/licenses/lucene-spatial3d-9.4.2.jar.sha1
deleted file mode 100644
index 86434e186dd..00000000000
--- a/solr/licenses/lucene-spatial3d-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-daf5b0ebc57270ab7be639c0cfac4ba388e2775c
diff --git a/solr/licenses/lucene-spatial3d-9.5.0.jar.sha1 b/solr/licenses/lucene-spatial3d-9.5.0.jar.sha1
new file mode 100644
index 00000000000..31ffb5638aa
--- /dev/null
+++ b/solr/licenses/lucene-spatial3d-9.5.0.jar.sha1
@@ -0,0 +1 @@
+01ed55dd384e654076b76d7083feee6ac3efe02b
diff --git a/solr/licenses/lucene-suggest-9.4.2.jar.sha1 b/solr/licenses/lucene-suggest-9.4.2.jar.sha1
deleted file mode 100644
index 9951eb761cc..00000000000
--- a/solr/licenses/lucene-suggest-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-e7749ec8f263a658104580a03d71bcb362370faf
diff --git a/solr/licenses/lucene-suggest-9.5.0.jar.sha1 b/solr/licenses/lucene-suggest-9.5.0.jar.sha1
new file mode 100644
index 00000000000..f575b77203f
--- /dev/null
+++ b/solr/licenses/lucene-suggest-9.5.0.jar.sha1
@@ -0,0 +1 @@
+195624eb3a09b3dc37cc5fa51ae2f7bd61553985
diff --git a/solr/licenses/lucene-test-framework-9.4.2.jar.sha1 b/solr/licenses/lucene-test-framework-9.4.2.jar.sha1
deleted file mode 100644
index a20bf3f9100..00000000000
--- a/solr/licenses/lucene-test-framework-9.4.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-dad1e731a41a184fdfe60bc6d1d0fe48b363af5f
diff --git a/solr/licenses/lucene-test-framework-9.5.0.jar.sha1 b/solr/licenses/lucene-test-framework-9.5.0.jar.sha1
new file mode 100644
index 00000000000..b8ed75e1df3
--- /dev/null
+++ b/solr/licenses/lucene-test-framework-9.5.0.jar.sha1
@@ -0,0 +1 @@
+586787143ce485f477e01a58834d9c8af907faf1
diff --git a/solr/modules/analysis-extras/src/java/org/apache/solr/update/processor/OpenNLPExtractNamedEntitiesUpdateProcessorFactory.java b/solr/modules/analysis-extras/src/java/org/apache/solr/update/processor/OpenNLPExtractNamedEntitiesUpdateProcessorFactory.java
index 6b674646704..e2d6c77c50e 100644
--- a/solr/modules/analysis-extras/src/java/org/apache/solr/update/processor/OpenNLPExtractNamedEntitiesUpdateProcessorFactory.java
+++ b/solr/modules/analysis-extras/src/java/org/apache/solr/update/processor/OpenNLPExtractNamedEntitiesUpdateProcessorFactory.java
@@ -34,12 +34,13 @@ import java.util.regex.PatternSyntaxException;
import opennlp.tools.util.Span;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
-import org.apache.lucene.analysis.opennlp.OpenNLPTokenizer;
+import org.apache.lucene.analysis.opennlp.SentenceAttributeExtractor;
import org.apache.lucene.analysis.opennlp.tools.NLPNERTaggerOp;
import org.apache.lucene.analysis.opennlp.tools.OpenNLPOpsFactory;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
-import org.apache.lucene.analysis.tokenattributes.FlagsAttribute;
import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
+import org.apache.lucene.analysis.tokenattributes.SentenceAttribute;
+import org.apache.lucene.util.AttributeSource;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.SolrInputDocument;
import org.apache.solr.common.SolrInputField;
@@ -636,28 +637,23 @@ public class OpenNLPExtractNamedEntitiesUpdateProcessorFactory extends UpdateReq
List<Integer> endOffsets = new ArrayList<>();
String fullText = srcFieldValue.toString();
TokenStream tokenStream = analyzer.tokenStream("", fullText);
- CharTermAttribute termAtt = tokenStream.addAttribute(CharTermAttribute.class);
- OffsetAttribute offsetAtt = tokenStream.addAttribute(OffsetAttribute.class);
- FlagsAttribute flagsAtt = tokenStream.addAttribute(FlagsAttribute.class);
+ SentenceAttributeExtractor sentenceAttributeExtractor =
+ new SentenceAttributeExtractor(
+ tokenStream, tokenStream.addAttribute(SentenceAttribute.class));
tokenStream.reset();
synchronized (nerTaggerOp) {
- while (tokenStream.incrementToken()) {
- terms.add(termAtt.toString());
- startOffsets.add(offsetAtt.startOffset());
- endOffsets.add(offsetAtt.endOffset());
- boolean endOfSentence = 0 != (flagsAtt.getFlags() & OpenNLPTokenizer.EOS_FLAG_BIT);
- if (endOfSentence) { // extract named entities one sentence at a time
- extractEntitiesFromSentence(
- fullText, terms, startOffsets, endOffsets, entitiesWithType);
+ while (!sentenceAttributeExtractor.allSentencesProcessed()) {
+ for (AttributeSource attributeSource :
+ sentenceAttributeExtractor.extractSentenceAttributes()) {
+ terms.add(attributeSource.getAttribute(CharTermAttribute.class).toString());
+ startOffsets.add(attributeSource.getAttribute(OffsetAttribute.class).startOffset());
+ endOffsets.add(attributeSource.getAttribute(OffsetAttribute.class).endOffset());
}
- }
- tokenStream.end();
- tokenStream.close();
- if (!terms.isEmpty()) { // In case last token of last sentence isn't properly flagged with
- // EOS_FLAG_BIT
extractEntitiesFromSentence(
fullText, terms, startOffsets, endOffsets, entitiesWithType);
}
+ tokenStream.end();
+ tokenStream.close();
nerTaggerOp.reset(); // Forget all adaptive data collected during previous calls
}
return entitiesWithType;
diff --git a/solr/server/solr/configsets/_default/conf/solrconfig.xml b/solr/server/solr/configsets/_default/conf/solrconfig.xml
index ca69ee01e65..9eb29ab91e4 100644
--- a/solr/server/solr/configsets/_default/conf/solrconfig.xml
+++ b/solr/server/solr/configsets/_default/conf/solrconfig.xml
@@ -35,7 +35,7 @@
that you fully re-index after changing this setting as it can
affect both how text is indexed and queried.
-->
- <luceneMatchVersion>9.4</luceneMatchVersion>
+ <luceneMatchVersion>9.5</luceneMatchVersion>
<!-- <lib/> directives can be used to instruct Solr to load any Jars
identified and use them to resolve any "plugins" specified in
diff --git a/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml b/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
index 82b74f054ad..32ea98950da 100644
--- a/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
+++ b/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
@@ -35,7 +35,7 @@
that you fully re-index after changing this setting as it can
affect both how text is indexed and queried.
-->
- <luceneMatchVersion>9.4</luceneMatchVersion>
+ <luceneMatchVersion>9.5</luceneMatchVersion>
<!-- <lib/> directives can be used to instruct Solr to load any Jars
identified and use them to resolve any "plugins" specified in
diff --git a/versions.lock b/versions.lock
index e977862d7d3..464f1a59ec8 100644
--- a/versions.lock
+++ b/versions.lock
@@ -165,7 +165,7 @@ net.sf.ehcache:ehcache-core:2.6.2 (1 constraints: 2706f94d)
net.sf.jopt-simple:jopt-simple:5.0.4 (1 constraints: be0ad6cc)
net.sourceforge.argparse4j:argparse4j:0.9.0 (1 constraints: 0b050636)
net.thisptr:jackson-jq:0.0.13 (1 constraints: 3605223b)
-org.antlr:antlr4-runtime:4.5.1-1 (1 constraints: 2810eea6)
+org.antlr:antlr4-runtime:4.11.1 (1 constraints: f70fbd96)
org.apache.calcite:calcite-core:1.34.0 (1 constraints: 3a053d3b)
org.apache.calcite:calcite-linq4j:1.34.0 (2 constraints: c912b74b)
org.apache.calcite.avatica:avatica-core:1.23.0 (3 constraints: fb20cdcb)
@@ -208,32 +208,32 @@ org.apache.logging.log4j:log4j-core:2.20.0 (5 constraints: 82556aef)
org.apache.logging.log4j:log4j-layout-template-json:2.20.0 (1 constraints: 3605333b)
org.apache.logging.log4j:log4j-slf4j2-impl:2.20.0 (1 constraints: 3605333b)
org.apache.logging.log4j:log4j-web:2.20.0 (1 constraints: 3605333b)
-org.apache.lucene:lucene-analysis-common:9.4.2 (10 constraints: e89eec62)
-org.apache.lucene:lucene-analysis-icu:9.4.2 (1 constraints: 11052636)
-org.apache.lucene:lucene-analysis-kuromoji:9.4.2 (1 constraints: 11052636)
-org.apache.lucene:lucene-analysis-morfologik:9.4.2 (1 constraints: 11052636)
-org.apache.lucene:lucene-analysis-nori:9.4.2 (1 constraints: 11052636)
-org.apache.lucene:lucene-analysis-opennlp:9.4.2 (1 constraints: 11052636)
-org.apache.lucene:lucene-analysis-phonetic:9.4.2 (1 constraints: 11052636)
-org.apache.lucene:lucene-analysis-smartcn:9.4.2 (1 constraints: 11052636)
-org.apache.lucene:lucene-analysis-stempel:9.4.2 (1 constraints: 11052636)
-org.apache.lucene:lucene-backward-codecs:9.4.2 (1 constraints: 11052636)
-org.apache.lucene:lucene-classification:9.4.2 (1 constraints: 11052636)
-org.apache.lucene:lucene-codecs:9.4.2 (3 constraints: a5259244)
-org.apache.lucene:lucene-core:9.4.2 (26 constraints: 2f90a69c)
-org.apache.lucene:lucene-expressions:9.4.2 (1 constraints: 11052636)
-org.apache.lucene:lucene-grouping:9.4.2 (2 constraints: e81552e4)
-org.apache.lucene:lucene-highlighter:9.4.2 (1 constraints: 11052636)
-org.apache.lucene:lucene-join:9.4.2 (1 constraints: 11052636)
-org.apache.lucene:lucene-memory:9.4.2 (1 constraints: 9b0fad83)
-org.apache.lucene:lucene-misc:9.4.2 (1 constraints: 11052636)
-org.apache.lucene:lucene-queries:9.4.2 (6 constraints: c051d07b)
-org.apache.lucene:lucene-queryparser:9.4.2 (1 constraints: 11052636)
-org.apache.lucene:lucene-sandbox:9.4.2 (2 constraints: df142ba1)
-org.apache.lucene:lucene-spatial-extras:9.4.2 (1 constraints: 11052636)
-org.apache.lucene:lucene-spatial3d:9.4.2 (1 constraints: be10b5b9)
-org.apache.lucene:lucene-suggest:9.4.2 (1 constraints: 11052636)
-org.apache.lucene:lucene-test-framework:9.4.2 (1 constraints: 11052636)
+org.apache.lucene:lucene-analysis-common:9.5.0 (10 constraints: de9e7c5a)
+org.apache.lucene:lucene-analysis-icu:9.5.0 (1 constraints: 10052736)
+org.apache.lucene:lucene-analysis-kuromoji:9.5.0 (1 constraints: 10052736)
+org.apache.lucene:lucene-analysis-morfologik:9.5.0 (1 constraints: 10052736)
+org.apache.lucene:lucene-analysis-nori:9.5.0 (1 constraints: 10052736)
+org.apache.lucene:lucene-analysis-opennlp:9.5.0 (1 constraints: 10052736)
+org.apache.lucene:lucene-analysis-phonetic:9.5.0 (1 constraints: 10052736)
+org.apache.lucene:lucene-analysis-smartcn:9.5.0 (1 constraints: 10052736)
+org.apache.lucene:lucene-analysis-stempel:9.5.0 (1 constraints: 10052736)
+org.apache.lucene:lucene-backward-codecs:9.5.0 (1 constraints: 10052736)
+org.apache.lucene:lucene-classification:9.5.0 (1 constraints: 10052736)
+org.apache.lucene:lucene-codecs:9.5.0 (3 constraints: a2250844)
+org.apache.lucene:lucene-core:9.5.0 (26 constraints: 1590c164)
+org.apache.lucene:lucene-expressions:9.5.0 (1 constraints: 10052736)
+org.apache.lucene:lucene-grouping:9.5.0 (2 constraints: e61524e4)
+org.apache.lucene:lucene-highlighter:9.5.0 (1 constraints: 10052736)
+org.apache.lucene:lucene-join:9.5.0 (1 constraints: 10052736)
+org.apache.lucene:lucene-memory:9.5.0 (1 constraints: 9a0fae83)
+org.apache.lucene:lucene-misc:9.5.0 (1 constraints: 10052736)
+org.apache.lucene:lucene-queries:9.5.0 (6 constraints: ba514a79)
+org.apache.lucene:lucene-queryparser:9.5.0 (1 constraints: 10052736)
+org.apache.lucene:lucene-sandbox:9.5.0 (2 constraints: dd1400a1)
+org.apache.lucene:lucene-spatial-extras:9.5.0 (1 constraints: 10052736)
+org.apache.lucene:lucene-spatial3d:9.5.0 (1 constraints: bd10b6b9)
+org.apache.lucene:lucene-suggest:9.5.0 (1 constraints: 10052736)
+org.apache.lucene:lucene-test-framework:9.5.0 (1 constraints: 10052736)
org.apache.opennlp:opennlp-tools:1.9.4 (2 constraints: f91d5c6d)
org.apache.pdfbox:fontbox:2.0.26 (1 constraints: 180b72d8)
org.apache.pdfbox:jbig2-imageio:3.0.4 (1 constraints: 5e0cef01)
diff --git a/versions.props b/versions.props
index cd1692ef3b6..8a691dbec1c 100644
--- a/versions.props
+++ b/versions.props
@@ -49,7 +49,7 @@ org.apache.httpcomponents:httpcore=4.4.16
org.apache.httpcomponents:httpmime=4.5.14
org.apache.kerby:*=1.0.1
org.apache.logging.log4j:*=2.20.0
-org.apache.lucene:*=9.4.2
+org.apache.lucene:*=9.5.0
org.apache.tika:*=1.28.5
org.apache.tomcat:annotations-api=6.0.53
org.apache.zookeeper:*=3.8.1