mirror of https://github.com/apache/lucene.git
LUCENE-8856: Promote intervals queries from sandbox to queries module
This commit is contained in:
parent
b48a02b1f1
commit
46cc24d77e
|
@ -47,6 +47,9 @@ API Changes
|
|||
and apply to all queries, rather than only booleans. (Atri Sharma, Adrien
|
||||
Grand, Alan Woodward)
|
||||
|
||||
* LUCENE-8856: Intervals queries have moved from the sandbox to the queries
|
||||
module. (Alan Woodward)
|
||||
|
||||
New Features
|
||||
|
||||
* LUCENE-8815: Provide a DoubleValues implementation for retrieving the value of features without
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
|
||||
import java.io.IOException;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
|
||||
import java.util.Arrays;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import org.apache.lucene.search.DocIdSetIterator;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import org.apache.lucene.search.MatchesIterator;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.util.Objects;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* <h2>Intervals queries</h2>
|
||||
*
|
||||
* This package contains experimental classes to search over intervals within fields
|
||||
*
|
||||
* <h2>IntervalsSource</h2>
|
||||
*
|
||||
* The {@link org.apache.lucene.queries.intervals.IntervalsSource} class can be used to construct proximity
|
||||
* relationships between terms and intervals. They can be built using static methods
|
||||
* in the {@link org.apache.lucene.queries.intervals.Intervals} class
|
||||
*
|
||||
* <h3>Basic intervals</h3>
|
||||
*
|
||||
* <ul>
|
||||
* <li>{@link org.apache.lucene.queries.intervals.Intervals#term(String)} — Represents a single term</li>
|
||||
* <li>{@link org.apache.lucene.queries.intervals.Intervals#phrase(java.lang.String...)} — Represents a phrase</li>
|
||||
* <li>{@link org.apache.lucene.queries.intervals.Intervals#ordered(IntervalsSource...)}
|
||||
* — Represents an interval over an ordered set of terms or intervals</li>
|
||||
* <li>{@link org.apache.lucene.queries.intervals.Intervals#unordered(IntervalsSource...)}
|
||||
* — Represents an interval over an unordered set of terms or intervals</li>
|
||||
* <li>{@link org.apache.lucene.queries.intervals.Intervals#or(IntervalsSource...)}
|
||||
* — Represents the disjunction of a set of terms or intervals</li>
|
||||
* </ul>
|
||||
*
|
||||
* <h3>Filters</h3>
|
||||
*
|
||||
* <ul>
|
||||
* <li>{@link org.apache.lucene.queries.intervals.Intervals#maxwidth(int, IntervalsSource)}
|
||||
* — Filters out intervals that are larger than a set width</li>
|
||||
* <li>{@link org.apache.lucene.queries.intervals.Intervals#maxgaps(int, IntervalsSource)}
|
||||
* — Filters out intervals that have more than a set number of gaps between their constituent sub-intervals</li>
|
||||
* <li>{@link org.apache.lucene.queries.intervals.Intervals#containedBy(IntervalsSource, IntervalsSource)}
|
||||
* — Returns intervals that are contained by another interval</li>
|
||||
* <li>{@link org.apache.lucene.queries.intervals.Intervals#notContainedBy(IntervalsSource, IntervalsSource)}
|
||||
* — Returns intervals that are *not* contained by another interval</li>
|
||||
* <li>{@link org.apache.lucene.queries.intervals.Intervals#containing(IntervalsSource, IntervalsSource)}
|
||||
* — Returns intervals that contain another interval</li>
|
||||
* <li>{@link org.apache.lucene.queries.intervals.Intervals#notContaining(IntervalsSource, IntervalsSource)}
|
||||
* — Returns intervals that do not contain another interval</li>
|
||||
* <li>{@link org.apache.lucene.queries.intervals.Intervals#nonOverlapping(IntervalsSource, IntervalsSource)}
|
||||
* — Returns intervals that do not overlap with another interval</li>
|
||||
* <li>{@link org.apache.lucene.queries.intervals.Intervals#notWithin(IntervalsSource, int, IntervalsSource)}
|
||||
* — Returns intervals that do not appear within a set number of positions of another interval</li>
|
||||
* </ul>
|
||||
*
|
||||
* <h2>IntervalQuery</h2>
|
||||
*
|
||||
* An {@link org.apache.lucene.queries.intervals.IntervalQuery} takes a field name and an {@link org.apache.lucene.queries.intervals.IntervalsSource},
|
||||
* and matches all documents that contain intervals defined by the source in that field.
|
||||
*/
|
||||
package org.apache.lucene.queries.intervals;
|
|
@ -15,11 +15,11 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import org.apache.lucene.util.LuceneTestCase;
|
||||
|
||||
import static org.apache.lucene.search.intervals.Intervals.*;
|
||||
import static org.apache.lucene.queries.intervals.Intervals.*;
|
||||
|
||||
public class TestDisjunctionRewrites extends LuceneTestCase {
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import java.io.IOException;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
import org.apache.lucene.analysis.MockTokenizer;
|
|
@ -15,7 +15,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.apache.lucene.search.intervals;
|
||||
package org.apache.lucene.queries.intervals;
|
||||
|
||||
import org.apache.lucene.util.LuceneTestCase;
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* <h2>Intervals queries</h2>
|
||||
*
|
||||
* This package contains experimental classes to search over intervals within fields
|
||||
*
|
||||
* <h2>IntervalsSource</h2>
|
||||
*
|
||||
* The {@link org.apache.lucene.search.intervals.IntervalsSource} class can be used to construct proximity
|
||||
* relationships between terms and intervals. They can be built using static methods
|
||||
* in the {@link org.apache.lucene.search.intervals.Intervals} class
|
||||
*
|
||||
* <h3>Basic intervals</h3>
|
||||
*
|
||||
* <ul>
|
||||
* <li>{@link org.apache.lucene.search.intervals.Intervals#term(String)} — Represents a single term</li>
|
||||
* <li>{@link org.apache.lucene.search.intervals.Intervals#phrase(java.lang.String...)} — Represents a phrase</li>
|
||||
* <li>{@link org.apache.lucene.search.intervals.Intervals#ordered(org.apache.lucene.search.intervals.IntervalsSource...)}
|
||||
* — Represents an interval over an ordered set of terms or intervals</li>
|
||||
* <li>{@link org.apache.lucene.search.intervals.Intervals#unordered(org.apache.lucene.search.intervals.IntervalsSource...)}
|
||||
* — Represents an interval over an unordered set of terms or intervals</li>
|
||||
* <li>{@link org.apache.lucene.search.intervals.Intervals#or(org.apache.lucene.search.intervals.IntervalsSource...)}
|
||||
* — Represents the disjunction of a set of terms or intervals</li>
|
||||
* </ul>
|
||||
*
|
||||
* <h3>Filters</h3>
|
||||
*
|
||||
* <ul>
|
||||
* <li>{@link org.apache.lucene.search.intervals.Intervals#maxwidth(int, org.apache.lucene.search.intervals.IntervalsSource)}
|
||||
* — Filters out intervals that are larger than a set width</li>
|
||||
* <li>{@link org.apache.lucene.search.intervals.Intervals#maxgaps(int, org.apache.lucene.search.intervals.IntervalsSource)}
|
||||
* — Filters out intervals that have more than a set number of gaps between their constituent sub-intervals</li>
|
||||
* <li>{@link org.apache.lucene.search.intervals.Intervals#containedBy(org.apache.lucene.search.intervals.IntervalsSource, org.apache.lucene.search.intervals.IntervalsSource)}
|
||||
* — Returns intervals that are contained by another interval</li>
|
||||
* <li>{@link org.apache.lucene.search.intervals.Intervals#notContainedBy(org.apache.lucene.search.intervals.IntervalsSource, org.apache.lucene.search.intervals.IntervalsSource)}
|
||||
* — Returns intervals that are *not* contained by another interval</li>
|
||||
* <li>{@link org.apache.lucene.search.intervals.Intervals#containing(org.apache.lucene.search.intervals.IntervalsSource, org.apache.lucene.search.intervals.IntervalsSource)}
|
||||
* — Returns intervals that contain another interval</li>
|
||||
* <li>{@link org.apache.lucene.search.intervals.Intervals#notContaining(org.apache.lucene.search.intervals.IntervalsSource, org.apache.lucene.search.intervals.IntervalsSource)}
|
||||
* — Returns intervals that do not contain another interval</li>
|
||||
* <li>{@link org.apache.lucene.search.intervals.Intervals#nonOverlapping(org.apache.lucene.search.intervals.IntervalsSource, org.apache.lucene.search.intervals.IntervalsSource)}
|
||||
* — Returns intervals that do not overlap with another interval</li>
|
||||
* <li>{@link org.apache.lucene.search.intervals.Intervals#notWithin(org.apache.lucene.search.intervals.IntervalsSource, int, org.apache.lucene.search.intervals.IntervalsSource)}
|
||||
* — Returns intervals that do not appear within a set number of positions of another interval</li>
|
||||
* </ul>
|
||||
*
|
||||
* <h2>IntervalQuery</h2>
|
||||
*
|
||||
* An {@link org.apache.lucene.search.intervals.IntervalQuery} takes a field name and an {@link org.apache.lucene.search.intervals.IntervalsSource},
|
||||
* and matches all documents that contain intervals defined by the source in that field.
|
||||
*/
|
||||
package org.apache.lucene.search.intervals;
|
Loading…
Reference in New Issue