diff --git a/x-pack/plugin/search-business-rules/build.gradle b/x-pack/plugin/search-business-rules/build.gradle index 3add3c939bb7e..31c83d675f3f8 100644 --- a/x-pack/plugin/search-business-rules/build.gradle +++ b/x-pack/plugin/search-business-rules/build.gradle @@ -14,10 +14,3 @@ dependencies { testImplementation(testArtifact(project(xpackModule('core')))) testImplementation project(":test:framework") } - -tasks.named('splitPackagesAudit').configure { - // Lucene classes should be owned by Lucene! - ignoreClasses 'org.apache.lucene.search.CappedScoreQuery', - 'org.apache.lucene.search.CappedScoreWeight', - 'org.apache.lucene.search.CappedScorer' -} diff --git a/x-pack/plugin/search-business-rules/src/main/java/org/apache/lucene/search/CappedScoreQuery.java b/x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/CappedScoreQuery.java similarity index 90% rename from x-pack/plugin/search-business-rules/src/main/java/org/apache/lucene/search/CappedScoreQuery.java rename to x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/CappedScoreQuery.java index 3f5de47c417d7..6f02d1c868cde 100644 --- a/x-pack/plugin/search-business-rules/src/main/java/org/apache/lucene/search/CappedScoreQuery.java +++ b/x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/CappedScoreQuery.java @@ -4,13 +4,29 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -package org.apache.lucene.search; +package org.elasticsearch.xpack.searchbusinessrules; import java.io.IOException; import java.util.Objects; import org.apache.lucene.index.IndexReader; import org.apache.lucene.index.LeafReaderContext; +import org.apache.lucene.search.BooleanClause; +import org.apache.lucene.search.BoostQuery; +import org.apache.lucene.search.BulkScorer; +import org.apache.lucene.search.DocIdSetIterator; +import org.apache.lucene.search.FilterLeafCollector; +import org.apache.lucene.search.FilterScorable; +import org.apache.lucene.search.IndexSearcher; +import org.apache.lucene.search.LeafCollector; +import org.apache.lucene.search.Matches; +import org.apache.lucene.search.Query; +import org.apache.lucene.search.QueryVisitor; +import org.apache.lucene.search.Scorable; +import org.apache.lucene.search.ScoreMode; +import org.apache.lucene.search.Scorer; +import org.apache.lucene.search.ScorerSupplier; +import org.apache.lucene.search.Weight; import org.apache.lucene.util.Bits; /** diff --git a/x-pack/plugin/search-business-rules/src/main/java/org/apache/lucene/search/CappedScoreWeight.java b/x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/CappedScoreWeight.java similarity index 96% rename from x-pack/plugin/search-business-rules/src/main/java/org/apache/lucene/search/CappedScoreWeight.java rename to x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/CappedScoreWeight.java index 42790a4f68b8e..aed361fa11626 100644 --- a/x-pack/plugin/search-business-rules/src/main/java/org/apache/lucene/search/CappedScoreWeight.java +++ b/x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/CappedScoreWeight.java @@ -5,10 +5,9 @@ * 2.0. */ -package org.apache.lucene.search; +package org.elasticsearch.xpack.searchbusinessrules; import org.apache.lucene.index.LeafReaderContext; -import org.apache.lucene.index.Term; import java.io.IOException; import java.util.Set; diff --git a/x-pack/plugin/search-business-rules/src/main/java/org/apache/lucene/search/CappedScorer.java b/x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/CappedScorer.java similarity index 83% rename from x-pack/plugin/search-business-rules/src/main/java/org/apache/lucene/search/CappedScorer.java rename to x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/CappedScorer.java index 523d11ee7958e..57b2b62b77f6d 100644 --- a/x-pack/plugin/search-business-rules/src/main/java/org/apache/lucene/search/CappedScorer.java +++ b/x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/CappedScorer.java @@ -5,7 +5,11 @@ * 2.0. */ -package org.apache.lucene.search; +package org.elasticsearch.xpack.searchbusinessrules; + +import org.apache.lucene.search.FilterScorer; +import org.apache.lucene.search.Scorer; +import org.apache.lucene.search.Weight; import java.io.IOException; diff --git a/x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilder.java b/x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilder.java index a296fb0684354..165be122a148d 100644 --- a/x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilder.java +++ b/x-pack/plugin/search-business-rules/src/main/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilder.java @@ -8,7 +8,6 @@ package org.elasticsearch.xpack.searchbusinessrules; import org.apache.lucene.search.BoostQuery; -import org.apache.lucene.search.CappedScoreQuery; import org.apache.lucene.search.ConstantScoreQuery; import org.apache.lucene.search.DisjunctionMaxQuery; import org.apache.lucene.search.MatchNoDocsQuery; diff --git a/x-pack/plugin/search-business-rules/src/test/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilderTests.java b/x-pack/plugin/search-business-rules/src/test/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilderTests.java index 5d00758c16abc..b9df0eea2b16e 100644 --- a/x-pack/plugin/search-business-rules/src/test/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilderTests.java +++ b/x-pack/plugin/search-business-rules/src/test/java/org/elasticsearch/xpack/searchbusinessrules/PinnedQueryBuilderTests.java @@ -9,7 +9,6 @@ import com.fasterxml.jackson.core.io.JsonStringEncoder; -import org.apache.lucene.search.CappedScoreQuery; import org.apache.lucene.search.DisjunctionMaxQuery; import org.apache.lucene.search.Query; import org.elasticsearch.common.ParsingException;