LUCENE-3283: Moved core QueryParsers to queryparser module

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1145016 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Christopher John Male 2011-07-11 03:37:00 +00:00
parent ef25bf2d31
commit 5f30bedccc
112 changed files with 656 additions and 196 deletions

View File

@ -49,6 +49,8 @@
<classpathentry kind="src" path="modules/grouping/src/test"/>
<classpathentry kind="src" path="modules/queries/src/java"/>
<classpathentry kind="src" path="modules/queries/src/test"/>
<classpathentry kind="src" path="modules/queryparser/src/java"/>
<classpathentry kind="src" path="modules/queryparser/src/test"/>
<classpathentry kind="src" path="modules/suggest/src/java"/>
<classpathentry kind="src" path="modules/suggest/src/test"/>
<classpathentry kind="src" path="solr/core/src/java"/>

View File

@ -25,6 +25,7 @@
<module filepath="$PROJECT_DIR$/modules/grouping/grouping.iml" />
<module filepath="$PROJECT_DIR$/modules/join/join.iml" />
<module filepath="$PROJECT_DIR$/modules/queries/queries.iml" />
<module filepath="$PROJECT_DIR$/modules/queryparser/queryparser.iml" />
<module filepath="$PROJECT_DIR$/modules/suggest/suggest.iml" />
<module filepath="$PROJECT_DIR$/solr/solr.iml" />
<module filepath="$PROJECT_DIR$/solr/contrib/analysis-extras/analysis-extras.iml" />

View File

@ -141,6 +141,13 @@
<option name="VM_PARAMETERS" value="-ea -DtempDir=temp" />
<option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option>
</configuration>
<configuration default="false" name="queryparser module" type="JUnit" factoryName="JUnit">
<module name="queryparser" />
<option name="TEST_OBJECT" value="package" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/modules/queries/build" />
<option name="VM_PARAMETERS" value="-ea -DtempDir=temp" />
<option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option>
</configuration>
<configuration default="false" name="queryparser contrib" type="JUnit" factoryName="JUnit">
<module name="queryparser-contrib" />
<option name="TEST_OBJECT" value="package" />
@ -204,7 +211,7 @@
<option name="VM_PARAMETERS" value="-ea -DtempDir=temp" />
<option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option>
</configuration>
<list size="29">
<list size="30">
<item index="0" class="java.lang.String" itemvalue="JUnit.analysis-extras contrib" />
<item index="1" class="java.lang.String" itemvalue="JUnit.benchmark module" />
<item index="2" class="java.lang.String" itemvalue="JUnit.clustering contrib" />
@ -225,15 +232,16 @@
<item index="17" class="java.lang.String" itemvalue="JUnit.phonetic analysis module" />
<item index="18" class="java.lang.String" itemvalue="JUnit.queries contrib" />
<item index="19" class="java.lang.String" itemvalue="JUnit.queries module" />
<item index="20" class="java.lang.String" itemvalue="JUnit.queryparser contrib" />
<item index="21" class="java.lang.String" itemvalue="JUnit.smartcn analysis module" />
<item index="22" class="java.lang.String" itemvalue="JUnit.solr" />
<item index="23" class="java.lang.String" itemvalue="JUnit.spatial contrib" />
<item index="24" class="java.lang.String" itemvalue="JUnit.stempel analysis module" />
<item index="25" class="java.lang.String" itemvalue="JUnit.suggest module" />
<item index="26" class="java.lang.String" itemvalue="JUnit.uima contrib" />
<item index="27" class="java.lang.String" itemvalue="JUnit.wordnet contrib" />
<item index="28" class="java.lang.String" itemvalue="JUnit.xml-query-parser contrib" />
<item index="20" class="java.lang.String" itemvalue="JUnit.queryparser module" />
<item index="21" class="java.lang.String" itemvalue="JUnit.queryparser contrib" />
<item index="22" class="java.lang.String" itemvalue="JUnit.smartcn analysis module" />
<item index="23" class="java.lang.String" itemvalue="JUnit.solr" />
<item index="24" class="java.lang.String" itemvalue="JUnit.spatial contrib" />
<item index="25" class="java.lang.String" itemvalue="JUnit.stempel analysis module" />
<item index="26" class="java.lang.String" itemvalue="JUnit.suggest module" />
<item index="27" class="java.lang.String" itemvalue="JUnit.uima contrib" />
<item index="28" class="java.lang.String" itemvalue="JUnit.wordnet contrib" />
<item index="29" class="java.lang.String" itemvalue="JUnit.xml-query-parser contrib" />
</list>
</component>
</project>

View File

@ -13,5 +13,6 @@
<orderEntry type="library" scope="TEST" name="JUnit" level="project" />
<orderEntry type="module" module-name="analysis-common" />
<orderEntry type="module" module-name="lucene" />
<orderEntry type="module" module-name="queryparser" />
</component>
</module>

View File

@ -14,5 +14,6 @@
<orderEntry type="module" module-name="queries-contrib" />
<orderEntry type="module" module-name="misc" />
<orderEntry type="module" module-name="lucene" />
<orderEntry type="module" module-name="queryparser" />
</component>
</module>

View File

@ -15,5 +15,6 @@
<orderEntry type="module" module-name="queries-contrib" />
<orderEntry type="module" module-name="misc" />
<orderEntry type="module" module-name="lucene" />
<orderEntry type="module" module-name="queryparser" />
</component>
</module>

View File

@ -18,5 +18,6 @@
<orderEntry type="module" module-name="misc" />
<orderEntry type="module" module-name="analysis-common" />
<orderEntry type="module" module-name="lucene" />
<orderEntry type="module" module-name="queryparser" />
</component>
</module>

View File

@ -30,5 +30,6 @@
<orderEntry type="module" module-name="memory" />
<orderEntry type="module" module-name="analysis-common" />
<orderEntry type="module" module-name="lucene" />
<orderEntry type="module" module-name="queryparser" />
</component>
</module>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/classes/java" />
<output-test url="file://$MODULE_DIR$/build/classes/test" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/work" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="TEST" name="JUnit" level="project" />
<orderEntry type="module" module-name="lucene" />
</component>
</module>

View File

@ -31,5 +31,6 @@
<orderEntry type="module" module-name="suggest" />
<orderEntry type="module" module-name="analysis-common" />
<orderEntry type="module" module-name="lucene" />
<orderEntry type="module" module-name="queryparser" />
</component>
</module>

View File

@ -52,6 +52,11 @@
<artifactId>lucene-analyzers-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>lucene-queryparser</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>

View File

@ -43,6 +43,12 @@
<artifactId>lucene-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>lucene-queryparser</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>lucene-test-framework</artifactId>

View File

@ -43,6 +43,11 @@
<artifactId>lucene-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>lucene-queryparser</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>lucene-core</artifactId>

View File

@ -52,6 +52,11 @@
<artifactId>lucene-queries-contrib</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>lucene-queryparser</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>

View File

@ -62,6 +62,11 @@
<artifactId>lucene-memory</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>lucene-queryparser</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>

View File

@ -37,6 +37,7 @@
<module>grouping</module>
<module>join</module>
<module>queries</module>
<module>queryparser</module>
<module>suggest</module>
</modules>
<build>

View File

@ -0,0 +1,71 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<!--
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.
-->
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-parent</artifactId>
<version>@version@</version>
<relativePath>../../lucene/pom.xml</relativePath>
</parent>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-queryparser</artifactId>
<packaging>jar</packaging>
<name>Lucene QueryParsers</name>
<description>Lucene QueryParsers module</description>
<properties>
<module-directory>modules/queryparser</module-directory>
<build-directory>build</build-directory>
</properties>
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>lucene-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>lucene-test-framework</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<directory>${build-directory}</directory>
<outputDirectory>${build-directory}/classes/java</outputDirectory>
<testOutputDirectory>${build-directory}/classes/test</testOutputDirectory>
<sourceDirectory>src/java</sourceDirectory>
<testSourceDirectory>src/test</testSourceDirectory>
<testResources>
<testResource>
<directory>${project.build.testSourceDirectory}</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</testResource>
</testResources>
</build>
</project>

View File

@ -83,7 +83,7 @@
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-queries-contrib</artifactId>
<artifactId>lucene-queryparser</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>

View File

@ -392,3 +392,16 @@ LUCENE-1458, LUCENE-2111: Flexible Indexing
boost from outer queries such as BooleanQuery, instead it takes 2 parameters,
the outer boost (topLevelBoost) and the norm. Weight.sumOfSquaredWeights has
been renamed to Weight.getValueForNormalization().
* LUCENE-3283: Lucene's core o.a.l.queryParser QueryParsers have been consolidated into module/queryparser,
where other QueryParsers from the codebase will also be placed. The following classes were moved:
- o.a.l.queryParser.CharStream -> o.a.l.queryparser.classic.CharStream
- o.a.l.queryParser.FastCharStream -> o.a.l.queryparser.classic.FastCharStream
- o.a.l.queryParser.MultiFieldQueryParser -> o.a.l.queryparser.classic.MultiFieldQueryParser
- o.a.l.queryParser.ParseException -> o.a.l.queryparser.classic.ParseException
- o.a.l.queryParser.QueryParser -> o.a.l.queryparser.classic.QueryParser
- o.a.l.queryParser.QueryParserBase -> o.a.l.queryparser.classic.QueryParserBase
- o.a.l.queryParser.QueryParserConstants -> o.a.l.queryparser.classic.QueryParserConstants
- o.a.l.queryParser.QueryParserTokenManager -> o.a.l.queryparser.classic.QueryParserTokenManager
- o.a.l.queryParser.QueryParserToken -> o.a.l.queryparser.classic.Token
- o.a.l.queryParser.QueryParserTokenMgrError -> o.a.l.queryparser.classic.TokenMgrError

View File

@ -206,6 +206,7 @@
<include name="**/lib/*.jar"/>
</fileset>
<pathelement location="${common.dir}/../modules/analysis/build/common/lucene-analyzers-common-${version}.jar"/>
<pathelement location="${common.dir}/../modules/queryparser/build/lucene-queryparser-${version}.jar"/>
</path>
<invoke-javadoc
@ -417,9 +418,6 @@
<!-- ================================================================== -->
<target name="clean-javacc">
<delete>
<fileset dir="src/java/org/apache/lucene/queryParser" includes="*.java">
<containsregexp expression="Generated.*By.*JavaCC"/>
</fileset>
<fileset dir="contrib/queryparser/src/java/org/apache/lucene/queryParser/surround/parser" includes="*.java">
<containsregexp expression="Generated.*By.*JavaCC"/>
</fileset>
@ -429,25 +427,7 @@
</delete>
</target>
<target name="javacc" depends="init,javacc-check,clean-javacc,javacc-QueryParser,javacc-contrib-queryparser,javacc-contrib-demo"/>
<target name="javacc-QueryParser" depends="init,javacc-check" if="javacc.present">
<sequential>
<invoke-javacc target="src/java/org/apache/lucene/queryParser/QueryParser.jj"
outputDir="src/java/org/apache/lucene/queryParser"/>
<!-- Change the inccorrect public ctors for QueryParser to be protected instead -->
<replaceregexp file="src/java/org/apache/lucene/queryParser/QueryParser.java"
byline="true"
match="public QueryParser\(CharStream "
replace="protected QueryParser(CharStream "/>
<replaceregexp file="src/java/org/apache/lucene/queryParser/QueryParser.java"
byline="true"
match="public QueryParser\(QueryParserTokenManager "
replace="protected QueryParser(QueryParserTokenManager "/>
</sequential>
</target>
<target name="javacc" depends="init,javacc-check,clean-javacc,javacc-contrib-queryparser,javacc-contrib-demo"/>
<target name="javacc-contrib-queryparser" depends="init,javacc-check" if="javacc.present">
<ant target="javacc"

View File

@ -29,6 +29,7 @@
<module-uptodate name="analysis/common" jarfile="${common.dir}/../modules/analysis/build/common/lucene-analyzers-common-${version}.jar"
property="analyzers-common.uptodate" classpath.property="analyzers-common.jar"/>
<module-uptodate name="queryparser" property="queryparser.uptodate" classpath.property="queryparser.jar"/>
<property name="lucene.jar" value="${common.dir}/build/lucene-core-${version}.jar"/>
<target name="lucene-jar-uptodate" unless="lucene.jar.uptodate">
@ -45,14 +46,22 @@
<path id="classpath">
<pathelement path="${analyzers-common.jar}"/>
<pathelement path="${queryparser.jar}"/>
<pathelement path="${lucene.jar}"/>
</path>
<target name="compile-core" depends="jar-analyzers-common,common.compile-core" />
<target name="compile-core" depends="jar-analyzers-common,build-queryparser,common.compile-core" />
<target name="jar-analyzers-common" unless="analyzers-common.uptodate">
<subant target="jar-core">
<fileset dir="${common.dir}/../modules/analysis/common" includes="build.xml"/>
</subant>
</target>
<target name="build-queryparser" unless="queryparser.uptodate">
<echo>Demo building dependency modules/queryparser</echo>
<subant target="default">
<fileset dir="${common.dir}/../modules/queryparser" includes="build.xml"/>
</subant>
</target>
</project>

View File

@ -27,7 +27,7 @@ import java.util.Date;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.ScoreDoc;

View File

@ -52,7 +52,6 @@ import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.Term;
import org.apache.lucene.index.IndexWriterConfig.OpenMode;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.search.*;
import org.apache.lucene.search.BooleanClause.Occur;
import org.apache.lucene.search.highlight.SynonymTokenizer.TestHighlightRunner;
@ -1630,7 +1629,7 @@ public class HighlighterTest extends BaseTokenStreamTestCase implements Formatte
private Directory dir;
private Analyzer a = new MockAnalyzer(random, MockTokenizer.WHITESPACE, false);
public void testWeightedTermsWithDeletes() throws IOException, ParseException, InvalidTokenOffsetsException {
public void testWeightedTermsWithDeletes() throws IOException, InvalidTokenOffsetsException {
makeIndex();
deleteDocument();
searchIndex();
@ -1660,7 +1659,7 @@ public class HighlighterTest extends BaseTokenStreamTestCase implements Formatte
writer.close();
}
private void searchIndex() throws IOException, ParseException, InvalidTokenOffsetsException {
private void searchIndex() throws IOException, InvalidTokenOffsetsException {
Query query = new TermQuery(new Term("t_text1", "random"));
IndexSearcher searcher = new IndexSearcher( dir, true );
// This scorer can return negative idf -> null fragment

View File

@ -42,7 +42,6 @@ import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.index.Term;
import org.apache.lucene.index.IndexWriterConfig.OpenMode;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.search.DisjunctionMaxQuery;
import org.apache.lucene.search.PhraseQuery;
import org.apache.lucene.search.Query;

View File

@ -24,4 +24,20 @@
</description>
<import file="../contrib-build.xml"/>
<module-uptodate name="queryparser" property="queryparser.uptodate" classpath.property="queryparser.jar"/>
<path id="test.classpath">
<pathelement path="${queryparser.jar}"/>
<path refid="test.base.classpath"/>
</path>
<target name="compile-core" depends="build-queryparser,common.compile-core" />
<target name="build-queryparser" unless="queryparser.uptodate">
<echo>Memory building dependency modules/queryparser</echo>
<subant target="default">
<fileset dir="${common.dir}/../modules/queryparser" includes="build.xml"/>
</subant>
</target>
</project>

View File

@ -33,7 +33,7 @@ import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.IndexWriterConfig;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.TopDocs;
import org.apache.lucene.store.Directory;

View File

@ -24,8 +24,15 @@
</description>
<import file="../contrib-build.xml"/>
<target name="compile-core" depends="javacc-notice, common.compile-core"/>
<module-uptodate name="queryparser" property="queryparser.uptodate" classpath.property="queryparser.jar"/>
<path id="classpath">
<pathelement path="${queryparser.jar}"/>
<path refid="base.classpath"/>
</path>
<target name="compile-core" depends="javacc-notice,build-queryparser,common.compile-core"/>
<!--
NOTE: see the README.javacc for details on how to fully regenerate the parser
@ -100,4 +107,11 @@ import org.apache.lucene.queryParser.core.messages.*;"
outputDir="src/java/org/apache/lucene/queryParser/surround/parser"
/>
</target>
<target name="build-queryparser" unless="queryparser.uptodate">
<echo>QueryParser Contrib building dependency modules/queryparser</echo>
<subant target="default">
<fileset dir="${common.dir}/../modules/queryparser" includes="build.xml"/>
</subant>
</target>
</project>

View File

@ -25,7 +25,7 @@ import java.util.List;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.search.Query;
import org.apache.lucene.util.Version;
@ -41,7 +41,7 @@ import org.apache.lucene.util.Version;
* using this parser will be no improvement over QueryParser in such cases).
*
*/
public class AnalyzingQueryParser extends org.apache.lucene.queryParser.QueryParser {
public class AnalyzingQueryParser extends org.apache.lucene.queryparser.classic.QueryParser {
/**
* Constructs a query parser.

View File

@ -25,8 +25,8 @@ import java.util.List;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.Term;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.MultiTermQuery;

View File

@ -18,9 +18,9 @@ package org.apache.lucene.queryParser.ext;
*/
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.queryParser.ext.Extensions.Pair;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.Query;
import org.apache.lucene.util.Version;

View File

@ -1,6 +1,6 @@
package org.apache.lucene.queryParser.ext;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.queryparser.classic.QueryParser;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more

View File

@ -16,10 +16,11 @@ package org.apache.lucene.queryParser.ext;
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.apache.lucene.queryparser.classic.QueryParser;
import java.util.HashMap;
import java.util.Map;
import org.apache.lucene.queryParser.QueryParser;
/**
* The {@link Extensions} class represents an extension mapping to associate

View File

@ -17,19 +17,19 @@ package org.apache.lucene.queryParser.ext;
* limitations under the License.
*/
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.search.Query;
/**
* This class represents an extension base class to the Lucene standard
* {@link QueryParser}. The {@link QueryParser} is generated by the JavaCC
* {@link org.apache.lucene.queryparser.classic.QueryParser}. The
* {@link org.apache.lucene.queryparser.classic.QueryParser} is generated by the JavaCC
* parser generator. Changing or adding functionality or syntax in the standard
* query parser requires changes to the JavaCC source file. To enable extending
* the standard query parser without changing the JavaCC sources and re-generate
* the parser the {@link ParserExtension} can be customized and plugged into an
* instance of {@link ExtendableQueryParser}, a direct subclass of
* {@link QueryParser}.
* {@link org.apache.lucene.queryparser.classic.QueryParser}.
*
* @see Extensions
* @see ExtendableQueryParser

View File

@ -25,7 +25,7 @@ import org.apache.lucene.analysis.MockTokenizer;
import org.apache.lucene.analysis.TokenFilter;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.util.LuceneTestCase;
/**

View File

@ -24,7 +24,7 @@ import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.ScoreDoc;

View File

@ -1,7 +1,7 @@
package org.apache.lucene.queryParser.ext;
import org.apache.lucene.index.Term;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TermQuery;
@ -30,4 +30,4 @@ class ExtensionStub extends ParserExtension {
.getRawQueryString()));
}
}
}

View File

@ -20,26 +20,21 @@ package org.apache.lucene.queryParser.ext;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.analysis.MockTokenizer;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.queryParser.TestQueryParser;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.util.LuceneTestCase;
/**
* Testcase for the class {@link ExtendableQueryParser}
*/
public class TestExtendableQueryParser extends TestQueryParser {
public class TestExtendableQueryParser extends LuceneTestCase {
private static char[] DELIMITERS = new char[] {
Extensions.DEFAULT_EXTENSION_FIELD_DELIMITER, '-', '|' };
@Override
public QueryParser getParser(Analyzer a) throws Exception {
return getParser(a, null);
}
public QueryParser getParser(Analyzer a, Extensions extensions)
throws Exception {
if (a == null)

View File

@ -35,7 +35,6 @@ import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import org.apache.lucene.document.DateTools;
import org.apache.lucene.queryParser.TestQueryParser;
import org.apache.lucene.queryParser.core.QueryNodeException;
import org.apache.lucene.queryParser.core.QueryNodeParseException;
import org.apache.lucene.queryParser.standard.config.StandardQueryConfigHandler;
@ -57,11 +56,11 @@ import org.apache.lucene.util.automaton.CharacterRunAutomaton;
* This test case tests {@link PrecedenceQueryParser}.
* </p>
* <p>
* It contains all tests from {@link TestQueryParser} with some adjusted to
* fit the precedence requirement, plus some precedence test cases.
* It contains all tests from {@link org.apache.lucene.queryparser.classic.TestQueryParser}
* with some adjusted to fit the precedence requirement, plus some precedence test cases.
* </p>
*
* @see TestQueryParser
* @see org.apache.lucene.queryparser.classic.TestQueryParser
*/
public class TestPrecedenceQueryParser extends LuceneTestCase {

View File

@ -29,21 +29,24 @@
<property name="lucene.jar" location="${common.dir}/build/lucene-core-${version}.jar"/>
<property name="servlet.jar" location="${common.dir}/lib/servlet-api-2.4.jar"/>
<available property="servlet.jar.present" type="file" file="${servlet.jar}"/>
<module-uptodate name="queryparser" property="queryparser.uptodate" classpath.property="queryparser.jar"/>
<path id="classpath">
<pathelement path="${queries.jar}"/>
<pathelement path="${queryparser.jar}"/>
<path refid="base.classpath"/>
</path>
<path id="web-classpath">
<pathelement path="${queries.jar}"/>
<pathelement path="${queryparser.jar}"/>
<pathelement path="${servlet.jar}"/>
<pathelement path="${build.dir}/${final.name}.jar"/>
<path refid="base.classpath"/>
</path>
<target name="compile-core" depends="build-queries, common.compile-core" />
<target name="compile-core" depends="build-queries,build-queryparser,common.compile-core" />
<target name="build-queries" unless="queries.uptodate">
<echo>XML Parser building dependency ${queries.jar}</echo>
@ -82,4 +85,11 @@
</target>
<target name="build-queryparser" unless="queryparser.uptodate">
<echo>Demo building dependency modules/queryparser</echo>
<subant target="default">
<fileset dir="${common.dir}/../modules/queryparser" includes="build.xml"/>
</subant>
</target>
</project>

View File

@ -6,7 +6,7 @@ import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.Query;
import org.apache.lucene.xmlparser.builders.*;
import org.w3c.dom.Document;

View File

@ -1,7 +1,7 @@
package org.apache.lucene.xmlparser;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.xmlparser.builders.BooleanFilterBuilder;
import org.apache.lucene.xmlparser.builders.BoostingQueryBuilder;
import org.apache.lucene.xmlparser.builders.DuplicateFilterBuilder;

View File

@ -1,8 +1,8 @@
package org.apache.lucene.xmlparser.builders;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.Query;
import org.apache.lucene.xmlparser.DOMUtils;
import org.apache.lucene.xmlparser.ParserException;

View File

@ -123,10 +123,8 @@ There are many post tokenization steps that can be done, including (but not limi
{@link org.apache.lucene.index.IndexWriter#addDocument(org.apache.lucene.document.Document) addDocument(doc)},
the Analyzer in effect for indexing is invoked for each indexed field of the added document.
</li>
<li>At search, as a consequence of
{@link org.apache.lucene.queryParser.QueryParser#parse(java.lang.String) QueryParser.parse(queryText)},
the QueryParser may invoke the Analyzer in effect.
Note that for some queries analysis does not take place, e.g. wildcard queries.
<li>At search, a QueryParser may invoke the Analyzer during parsing. Note that for some queries, analysis does not
take place, e.g. wildcard queries.
</li>
</ul>
However an application might invoke Analysis of any text for testing or for any other purpose, something like:

View File

@ -23,7 +23,6 @@ import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.Term;
import org.apache.lucene.index.Terms;
import org.apache.lucene.index.TermsEnum;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.util.AttributeSource;
import org.apache.lucene.util.TermContext;
@ -56,7 +55,7 @@ import org.apache.lucene.util.TermContext;
* a priority queue to only collect competitive terms
* and not hit this limitation.
*
* Note that {@link QueryParser} produces
* Note that org.apache.lucene.queryparser.classic.QueryParser produces
* MultiTermQueries using {@link
* #CONSTANT_SCORE_AUTO_REWRITE_DEFAULT} by default.
*/

View File

@ -39,10 +39,6 @@ import org.apache.lucene.index.Term;
<li> {@link NumericRangeQuery}
<li> {@link org.apache.lucene.search.spans.SpanQuery}
</ul>
<p>A parser for queries is contained in:
<ul>
<li>{@link org.apache.lucene.queryParser.QueryParser QueryParser}
</ul>
*/
public abstract class Query implements Cloneable {
private float boost = 1.0f; // query boost factor
@ -61,17 +57,6 @@ public abstract class Query implements Cloneable {
/** Prints a query to a string, with <code>field</code> assumed to be the
* default field and omitted.
* <p>The representation used is one that is supposed to be readable
* by {@link org.apache.lucene.queryParser.QueryParser QueryParser}. However,
* there are the following limitations:
* <ul>
* <li>If the query was created by the parser, the printed
* representation may not be exactly what was parsed. For example,
* characters that need to be escaped will be represented without
* the required backslash.</li>
* <li>Some of the more complicated queries (e.g. span queries)
* don't have a representation that can be parsed by QueryParser.</li>
* </ul>
*/
public abstract String toString(String field);

View File

@ -23,7 +23,6 @@ import org.apache.lucene.index.Term;
import org.apache.lucene.index.TermsEnum;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.MultiFields;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.TermContext;
@ -465,7 +464,7 @@ public class TestMultiPhraseQuery extends LuceneTestCase {
* using query parser, MPQ will be created, and will not be strict about having all query terms
* in each position - one of each position is sufficient (OR logic)
*/
public void testZeroPosIncrSloppyParsedAnd() throws IOException, ParseException {
public void testZeroPosIncrSloppyParsedAnd() throws IOException {
MultiPhraseQuery q = new MultiPhraseQuery();
q.add(new Term[]{ new Term("field", "a"), new Term("field", "1") }, -1);
q.add(new Term[]{ new Term("field", "b"), new Term("field", "1") }, 0);
@ -509,7 +508,7 @@ public class TestMultiPhraseQuery extends LuceneTestCase {
/**
* PQ AND Mode - Manually creating a phrase query
*/
public void testZeroPosIncrSloppyPqAnd() throws IOException, ParseException {
public void testZeroPosIncrSloppyPqAnd() throws IOException {
final PhraseQuery pq = new PhraseQuery();
for (TokenAndPos tap : INCR_0_QUERY_TOKENS_AND) {
pq.add(new Term("field",tap.token), tap.pos);
@ -524,7 +523,7 @@ public class TestMultiPhraseQuery extends LuceneTestCase {
/**
* MPQ AND Mode - Manually creating a multiple phrase query
*/
public void testZeroPosIncrSloppyMpqAnd() throws IOException, ParseException {
public void testZeroPosIncrSloppyMpqAnd() throws IOException {
final MultiPhraseQuery mpq = new MultiPhraseQuery();
for (TokenAndPos tap : INCR_0_QUERY_TOKENS_AND) {
mpq.add(new Term[]{new Term("field",tap.token)}, tap.pos); //AND logic
@ -539,7 +538,7 @@ public class TestMultiPhraseQuery extends LuceneTestCase {
/**
* MPQ Combined AND OR Mode - Manually creating a multiple phrase query
*/
public void testZeroPosIncrSloppyMpqAndOrMatch() throws IOException, ParseException {
public void testZeroPosIncrSloppyMpqAndOrMatch() throws IOException {
final MultiPhraseQuery mpq = new MultiPhraseQuery();
for (TokenAndPos tap[] : INCR_0_QUERY_TOKENS_AND_OR_MATCH) {
Term[] terms = tapTerms(tap);
@ -556,7 +555,7 @@ public class TestMultiPhraseQuery extends LuceneTestCase {
/**
* MPQ Combined AND OR Mode - Manually creating a multiple phrase query - with no match
*/
public void testZeroPosIncrSloppyMpqAndOrNoMatch() throws IOException, ParseException {
public void testZeroPosIncrSloppyMpqAndOrNoMatch() throws IOException {
final MultiPhraseQuery mpq = new MultiPhraseQuery();
for (TokenAndPos tap[] : INCR_0_QUERY_TOKENS_AND_OR_NO_MATCHN) {
Term[] terms = tapTerms(tap);

View File

@ -38,7 +38,6 @@ import org.apache.lucene.index.RandomIndexWriter;
import org.apache.lucene.index.Term;
import org.apache.lucene.index.codecs.CodecProvider;
import org.apache.lucene.index.values.ValueType;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.search.BooleanClause.Occur;
import org.apache.lucene.search.FieldValueHitQueue.Entry;
import org.apache.lucene.search.cache.ByteValuesCreator;
@ -365,7 +364,7 @@ public class TestSort extends LuceneTestCase {
/**
* Test String sorting: small queue to many matches, multi field sort, reverse sort
*/
public void testStringSort() throws IOException, ParseException {
public void testStringSort() throws IOException {
ScoreDoc[] result = null;
IndexSearcher searcher = getFullStrings();
sort.setSort(

View File

@ -26,7 +26,6 @@ import org.apache.lucene.analysis.util.FilteringTokenFilter;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
import org.apache.lucene.analysis.util.CharArraySet;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.util.Version;
/**

View File

@ -22,7 +22,6 @@ import java.io.IOException;
import org.apache.lucene.analysis.TokenFilter;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
import org.apache.lucene.queryParser.QueryParser; // for javadoc
/**
* Abstract base class for TokenFilters that may remove tokens.
@ -87,7 +86,7 @@ public abstract class FilteringTokenFilter extends TokenFilter {
* token is incremented.
*
* <p> <b>NOTE</b>: be sure to also
* set {@link QueryParser#setEnablePositionIncrements} if
* set org.apache.lucene.queryparser.classic.QueryParser#setEnablePositionIncrements if
* you use QueryParser to create queries.
*/
public void setEnablePositionIncrements(boolean enable) {

View File

@ -41,6 +41,8 @@
property="analyzers-common.uptodate" classpath.property="analyzers-common.jar"/>
<contrib-uptodate name="memory" property="memory.uptodate" classpath.property="memory.jar"/>
<module-uptodate name="queryparser" property="queryparser.uptodate" classpath.property="queryparser.jar"/>
<target name="check-files">
<available file="temp/news20.tar.gz" property="news20.exists"/>
@ -160,6 +162,7 @@
<pathelement path="${memory.jar}"/>
<pathelement path="${highlighter.jar}"/>
<pathelement path="${analyzers-common.jar}"/>
<pathelement path="${queryparser.jar}"/>
<path refid="base.classpath"/>
<fileset dir="lib">
<include name="**/*.jar"/>
@ -268,8 +271,13 @@
<fileset dir="${common.dir}/contrib/memory" includes="build.xml"/>
</subant>
</target>
<target name="compile-queryparser" unless="queryparser.uptodate">
<subant target="default">
<fileset dir="${common.dir}/../modules/queryparser" includes="build.xml"/>
</subant>
</target>
<target name="init" depends="contrib-build.init,compile-memory,compile-highlighter,compile-analyzers-common"/>
<target name="init" depends="contrib-build.init,compile-memory,compile-highlighter,compile-analyzers-common,compile-queryparser"/>
<target name="clean-javacc">
<fileset dir="src/java/org/apache/lucene/benchmark/byTask/feeds/demohtml" includes="*.java">

View File

@ -24,7 +24,7 @@ import java.util.List;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.index.Term;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.MultiTermQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.WildcardQuery;

View File

@ -1,8 +1,8 @@
package org.apache.lucene.benchmark.byTask.feeds;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.Query;
import org.apache.lucene.benchmark.byTask.tasks.NewAnalyzerTask;
import org.apache.lucene.util.Version;

View File

@ -21,7 +21,7 @@ import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.benchmark.byTask.tasks.NewAnalyzerTask;
import org.apache.lucene.benchmark.byTask.utils.Config;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.Query;
import org.apache.lucene.util.English;
import org.apache.lucene.util.Version;

View File

@ -19,7 +19,7 @@ package org.apache.lucene.benchmark.byTask.feeds;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.index.Term;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.WildcardQuery;
import org.apache.lucene.search.spans.SpanFirstQuery;

View File

@ -19,7 +19,7 @@ package org.apache.lucene.benchmark.byTask.feeds;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.index.Term;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.BooleanClause.Occur;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.Query;

View File

@ -16,7 +16,7 @@
*/
package org.apache.lucene.benchmark.quality;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.search.Query;
/**

View File

@ -19,8 +19,8 @@ package org.apache.lucene.benchmark.quality.utils;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.benchmark.quality.QualityQuery;
import org.apache.lucene.benchmark.quality.QualityQueryParser;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.Query;

View File

@ -28,6 +28,7 @@
<fileset dir="grouping" includes="build.xml" />
<fileset dir="join" includes="build.xml" />
<fileset dir="queries" includes="build.xml" />
<fileset dir="queryparser" includes="build.xml" />
<fileset dir="suggest" includes="build.xml" />
</subant>
</sequential>
@ -42,6 +43,7 @@
<fileset dir="grouping" includes="build.xml" />
<fileset dir="join" includes="build.xml" />
<fileset dir="queries" includes="build.xml" />
<fileset dir="queryparser" includes="build.xml" />
<fileset dir="suggest" includes="build.xml" />
</subant>
</sequential>
@ -56,6 +58,7 @@
<fileset dir="grouping" includes="build.xml" />
<fileset dir="join" includes="build.xml" />
<fileset dir="queries" includes="build.xml" />
<fileset dir="queryparser" includes="build.xml" />
<fileset dir="suggest" includes="build.xml" />
</subant>
</sequential>
@ -70,6 +73,7 @@
<fileset dir="grouping" includes="build.xml" />
<fileset dir="join" includes="build.xml" />
<fileset dir="queries" includes="build.xml" />
<fileset dir="queryparser" includes="build.xml" />
<fileset dir="suggest" includes="build.xml" />
</subant>
</sequential>
@ -85,6 +89,7 @@
<fileset dir="grouping" includes="build.xml" />
<fileset dir="join" includes="build.xml" />
<fileset dir="queries" includes="build.xml" />
<fileset dir="queryparser" includes="build.xml" />
<fileset dir="suggest" includes="build.xml" />
</subant>
</sequential>
@ -98,6 +103,7 @@
<fileset dir="grouping" includes="build.xml" />
<fileset dir="join" includes="build.xml" />
<fileset dir="queries" includes="build.xml" />
<fileset dir="queryparser" includes="build.xml" />
<fileset dir="suggest" includes="build.xml" />
</subant>
</sequential>
@ -113,6 +119,7 @@
<fileset dir="grouping" includes="build.xml" />
<fileset dir="join" includes="build.xml" />
<fileset dir="queries" includes="build.xml" />
<fileset dir="queryparser" includes="build.xml" />
<fileset dir="suggest" includes="build.xml" />
</subant>
</sequential>

View File

@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed 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.

View File

@ -0,0 +1,5 @@
Apache Lucene QueryParsers
Copyright 2011 The Apache Software Foundation
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).

View File

@ -0,0 +1,59 @@
<!--
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.
-->
<project name="queryparser" default="default">
<description>
Lucene QueryParsers
</description>
<property name="build.dir" location="build/"/>
<property name="dist.dir" location="dist/"/>
<property name="maven.dist.dir" location="../dist/maven"/>
<import file="../../lucene/contrib/contrib-build.xml"/>
<target name="dist-maven" depends="jar-core,javadocs,contrib-build.dist-maven"/>
<target name="clean-javacc">
<delete>
<fileset dir="src/java/org/apache/lucene/queryparser/classic" includes="*.java">
<containsregexp expression="Generated.*By.*JavaCC"/>
</fileset>
</delete>
</target>
<target name="javacc" depends="init,javacc-check,clean-javacc,javacc-QueryParser"/>
<target name="javacc-QueryParser" depends="init,javacc-check" if="javacc.present">
<sequential>
<invoke-javacc target="src/java/org/apache/lucene/queryparser/classic/QueryParser.jj"
outputDir="src/java/org/apache/lucene/queryparser/classic"/>
<!-- Change the incorrect public ctors for QueryParser to be protected instead -->
<replaceregexp file="src/java/org/apache/lucene/queryparser/classic/QueryParser.java"
byline="true"
match="public QueryParser\(CharStream "
replace="protected QueryParser(CharStream "/>
<replaceregexp file="src/java/org/apache/lucene/queryparser/classic/QueryParser.java"
byline="true"
match="public QueryParser\(QueryParserTokenManager "
replace="protected QueryParser(QueryParserTokenManager "/>
</sequential>
</target>
</project>

View File

@ -1,6 +1,6 @@
/* Generated By:JavaCC: Do not edit this line. CharStream.java Version 4.1 */
/* JavaCCOptions:STATIC=false */
package org.apache.lucene.queryParser;
package org.apache.lucene.queryparser.classic;
/**
* This interface describes a character stream that maintains line and
@ -28,14 +28,14 @@ public interface CharStream {
/**
* Returns the column position of the character last read.
* @deprecated (gen)
* @deprecated
* @see #getEndColumn
*/
int getColumn();
/**
* Returns the line number of the character last read.
* @deprecated (gen)
* @deprecated
* @see #getEndLine
*/
int getLine();
@ -109,4 +109,4 @@ public interface CharStream {
void Done();
}
/* JavaCC - OriginalChecksum=32a89423891f765dde472f7ef0e3ef7b (do not edit this line) */
/* JavaCC - OriginalChecksum=0790771f0d47abfd976f028fa2364b0f (do not edit this line) */

View File

@ -1,5 +1,5 @@
// FastCharStream.java
package org.apache.lucene.queryParser;
package org.apache.lucene.queryparser.classic;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more

View File

@ -1,4 +1,4 @@
package org.apache.lucene.queryParser;
package org.apache.lucene.queryparser.classic;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more

View File

@ -1,6 +1,6 @@
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 4.1 */
/* JavaCCOptions:KEEP_LINE_COL=null */
package org.apache.lucene.queryParser;
package org.apache.lucene.queryparser.classic;
/**
* This exception is thrown when parse errors are encountered.
@ -195,4 +195,4 @@ public class ParseException extends Exception {
}
}
/* JavaCC - OriginalChecksum=c7631a240f7446940695eac31d9483ca (do not edit this line) */
/* JavaCC - OriginalChecksum=f669ffb14d5be55de6298772ac9befeb (do not edit this line) */

View File

@ -1,5 +1,5 @@
/* Generated By:JavaCC: Do not edit this line. QueryParser.java */
package org.apache.lucene.queryParser;
package org.apache.lucene.queryparser.classic;
import java.io.StringReader;
import java.util.ArrayList;
@ -640,7 +640,7 @@ public class QueryParser extends QueryParserBase implements QueryParserConstants
return (jj_ntk = jj_nt.kind);
}
private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>();
private java.util.List jj_expentries = new java.util.ArrayList();
private int[] jj_expentry;
private int jj_kind = -1;
private int[] jj_lasttokens = new int[100];
@ -703,7 +703,7 @@ public class QueryParser extends QueryParserBase implements QueryParserConstants
jj_add_error_token(0, 0);
int[][] exptokseq = new int[jj_expentries.size()][];
for (int i = 0; i < jj_expentries.size(); i++) {
exptokseq[i] = jj_expentries.get(i);
exptokseq[i] = (int[])jj_expentries.get(i);
}
return new ParseException(token, exptokseq, tokenImage);
}

View File

@ -23,7 +23,7 @@ options {
PARSER_BEGIN(QueryParser)
package org.apache.lucene.queryParser;
package org.apache.lucene.queryparser.classic;
import java.io.StringReader;
import java.util.ArrayList;

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.lucene.queryParser;
package org.apache.lucene.queryparser.classic;
import java.io.IOException;
import java.io.StringReader;
@ -30,7 +30,7 @@ import org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
import org.apache.lucene.analysis.tokenattributes.TermToBytesRefAttribute;
import org.apache.lucene.document.DateTools;
import org.apache.lucene.index.Term;
import org.apache.lucene.queryParser.QueryParser.Operator;
import org.apache.lucene.queryparser.classic.QueryParser.Operator;
import org.apache.lucene.search.*;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.Version;
@ -459,14 +459,14 @@ public abstract class QueryParserBase {
}
/**
* @exception org.apache.lucene.queryParser.ParseException throw in overridden method to disallow
* @exception org.apache.lucene.queryparser.classic.ParseException throw in overridden method to disallow
*/
protected Query getFieldQuery(String field, String queryText, boolean quoted) throws ParseException {
return newFieldQuery(analyzer, field, queryText, quoted);
}
/**
* @exception org.apache.lucene.queryParser.ParseException throw in overridden method to disallow
* @exception org.apache.lucene.queryparser.classic.ParseException throw in overridden method to disallow
*/
protected Query newFieldQuery(Analyzer analyzer, String field, String queryText, boolean quoted) throws ParseException {
// Use the analyzer to get all the tokens, and then build a TermQuery,
@ -644,7 +644,7 @@ public abstract class QueryParserBase {
* This method may be overridden, for example, to return
* a SpanNearQuery instead of a PhraseQuery.
*
* @exception org.apache.lucene.queryParser.ParseException throw in overridden method to disallow
* @exception org.apache.lucene.queryparser.classic.ParseException throw in overridden method to disallow
*/
protected Query getFieldQuery(String field, String queryText, int slop)
throws ParseException {
@ -662,7 +662,7 @@ public abstract class QueryParserBase {
/**
*
* @exception org.apache.lucene.queryParser.ParseException
* @exception org.apache.lucene.queryparser.classic.ParseException
*/
protected Query getRangeQuery(String field,
String part1,
@ -874,7 +874,7 @@ public abstract class QueryParserBase {
* to join.
*
* @return Resulting {@link org.apache.lucene.search.Query} object.
* @exception org.apache.lucene.queryParser.ParseException throw in overridden method to disallow
* @exception org.apache.lucene.queryparser.classic.ParseException throw in overridden method to disallow
*/
protected Query getBooleanQuery(List<BooleanClause> clauses) throws ParseException {
return getBooleanQuery(clauses, false);
@ -892,7 +892,7 @@ public abstract class QueryParserBase {
* @param disableCoord true if coord scoring should be disabled.
*
* @return Resulting {@link org.apache.lucene.search.Query} object.
* @exception org.apache.lucene.queryParser.ParseException throw in overridden method to disallow
* @exception org.apache.lucene.queryparser.classic.ParseException throw in overridden method to disallow
*/
protected Query getBooleanQuery(List<BooleanClause> clauses, boolean disableCoord)
throws ParseException
@ -926,7 +926,7 @@ public abstract class QueryParserBase {
* characters (? or *), but is not simple prefix term
*
* @return Resulting {@link org.apache.lucene.search.Query} built for the term
* @exception org.apache.lucene.queryParser.ParseException throw in overridden method to disallow
* @exception org.apache.lucene.queryparser.classic.ParseException throw in overridden method to disallow
*/
protected Query getWildcardQuery(String field, String termStr) throws ParseException
{
@ -960,7 +960,7 @@ public abstract class QueryParserBase {
* @param termStr Term token that contains a regular expression
*
* @return Resulting {@link org.apache.lucene.search.Query} built for the term
* @exception org.apache.lucene.queryParser.ParseException throw in overridden method to disallow
* @exception org.apache.lucene.queryparser.classic.ParseException throw in overridden method to disallow
*/
protected Query getRegexpQuery(String field, String termStr) throws ParseException
{
@ -992,7 +992,7 @@ public abstract class QueryParserBase {
* (<b>without</b> trailing '*' character!)
*
* @return Resulting {@link org.apache.lucene.search.Query} built for the term
* @exception org.apache.lucene.queryParser.ParseException throw in overridden method to disallow
* @exception org.apache.lucene.queryparser.classic.ParseException throw in overridden method to disallow
*/
protected Query getPrefixQuery(String field, String termStr) throws ParseException
{
@ -1014,7 +1014,7 @@ public abstract class QueryParserBase {
* @param termStr Term token to use for building term for the query
*
* @return Resulting {@link org.apache.lucene.search.Query} built for the term
* @exception org.apache.lucene.queryParser.ParseException throw in overridden method to disallow
* @exception org.apache.lucene.queryparser.classic.ParseException throw in overridden method to disallow
*/
protected Query getFuzzyQuery(String field, String termStr, float minSimilarity) throws ParseException
{

View File

@ -1,5 +1,5 @@
/* Generated By:JavaCC: Do not edit this line. QueryParserConstants.java */
package org.apache.lucene.queryParser;
package org.apache.lucene.queryparser.classic;
/**

View File

@ -1,5 +1,5 @@
/* Generated By:JavaCC: Do not edit this line. QueryParserTokenManager.java */
package org.apache.lucene.queryParser;
package org.apache.lucene.queryparser.classic;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;

View File

@ -1,6 +1,6 @@
/* Generated By:JavaCC: Do not edit this line. Token.java Version 4.1 */
/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null */
package org.apache.lucene.queryParser;
package org.apache.lucene.queryparser.classic;
/**
* Describes the input token stream.
@ -121,4 +121,4 @@ public class Token {
}
}
/* JavaCC - OriginalChecksum=c147cc166a7cf8812c7c39bc8c5eb868 (do not edit this line) */
/* JavaCC - OriginalChecksum=9f74ef8b727ef4e5dafb84a45b3584c9 (do not edit this line) */

View File

@ -1,6 +1,6 @@
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 4.1 */
/* JavaCCOptions: */
package org.apache.lucene.queryParser;
package org.apache.lucene.queryparser.classic;
/** Token Manager Error. */
@SuppressWarnings("serial")
@ -138,4 +138,4 @@ public class TokenMgrError extends Error
this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
}
}
/* JavaCC - OriginalChecksum=1c94e13236c7e0121e49427992341ee3 (do not edit this line) */
/* JavaCC - OriginalChecksum=b55ad725f5fbc672fa115f498926930c (do not edit this line) */

View File

@ -0,0 +1,26 @@
<!--
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.
-->
<html>
<head>
<title>
QueryParsers
</title>
</head>
<body>
QueryParsers
</body>
</html>

View File

@ -1,4 +1,4 @@
package org.apache.lucene.queryParser;
package org.apache.lucene.queryparser.classic;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more

View File

@ -1,4 +1,4 @@
package org.apache.lucene.queryParser;
package org.apache.lucene.queryparser.classic;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more

View File

@ -1,4 +1,4 @@
package org.apache.lucene.queryParser;
package org.apache.lucene.queryparser.classic;
/*
* Licensed to the Apache Software Foundation (ASF) under one or more

View File

@ -1,4 +1,4 @@
package org.apache.lucene.queryParser;
package org.apache.lucene.queryparser.classic;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more

View File

@ -89,6 +89,8 @@
property="grouping.uptodate" classpath.property="grouping.jar"/>
<module-uptodate name="queries" jarfile="${common.dir}/../modules/queries/build/lucene-queries-${version}.jar"
property="queries.uptodate" classpath.property="queries.jar"/>
<module-uptodate name="queryparser" jarfile="${common.dir}/../modules/queryparser/build/lucene-queryparser-${version}.jar"
property="queryparser.uptodate" classpath.property="queryparser.jar"/>
<contrib-uptodate name="highlighter" property="highlighter.uptodate" classpath.property="highlighter.jar"/>
<contrib-uptodate name="memory" property="memory.uptodate" classpath.property="memory.jar"/>
<contrib-uptodate name="misc" property="misc.uptodate" classpath.property="misc.jar"/>
@ -120,6 +122,11 @@
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
</target>
<target name="compile-queryparser" unless="queryparser.uptodate">
<ant dir="${common.dir}/../modules/queryparser" target="default" inheritAll="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
</target>
<target name="compile-highlighter" unless="highlighter.uptodate">
<ant dir="${common.dir}/contrib/highlighter" target="default" inheritAll="false">
<propertyset refid="uptodate.and.compiled.properties"/>
@ -163,6 +170,7 @@
<pathelement path="${suggest.jar}"/>
<pathelement path="${grouping.jar}"/>
<pathelement path="${queries.jar}"/>
<pathelement path="${queryparser.jar}"/>
<pathelement location="${common-solr.dir}/build/solr-solrj/classes/java"/>
<pathelement location="${common-solr.dir}/build/solr-core/classes/java"/>
<path refid="base.classpath"/>
@ -245,7 +253,7 @@
<target name="prep-lucene-jars"
depends="compile-analyzers-common, compile-analyzers-phonetic, compile-suggest,
compile-highlighter, compile-memory, compile-misc, compile-queries-contrib,
compile-spatial, compile-grouping, compile-queries">
compile-spatial, compile-grouping, compile-queries, compile-queryparser">
<ant dir="${common.dir}" target="default" inheritall="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
@ -260,6 +268,7 @@
<fileset file="${grouping.jar}" />
<fileset file="${common-module.jar}" />
<fileset file="${queries.jar}" />
<fileset file="${queryparser.jar}" />
<fileset file="${highlighter.jar}" />
<fileset file="${memory.jar}" />
<fileset file="${misc.jar}" />

View File

@ -32,7 +32,7 @@ import java.util.regex.Pattern;
import org.apache.lucene.document.Document;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.Term;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.search.*;
import org.apache.lucene.search.similar.MoreLikeThis;
import org.apache.solr.common.SolrException;

View File

@ -17,6 +17,7 @@
package org.apache.solr.handler;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.NamedList;
@ -27,7 +28,6 @@ import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrRequestHandler;
import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.util.SolrPluginUtils;
import org.apache.lucene.queryParser.ParseException;
import java.net.URL;

View File

@ -17,7 +17,7 @@
package org.apache.solr.handler.component;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.util.OpenBitSet;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.params.CommonParams;

View File

@ -21,7 +21,7 @@ import org.apache.lucene.document.Field;
import org.apache.lucene.index.IndexReader.AtomicReaderContext;
import org.apache.lucene.index.IndexReader.ReaderContext;
import org.apache.lucene.index.Term;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.search.*;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.CharsRef;

View File

@ -17,7 +17,7 @@
package org.apache.solr.handler.component;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.params.ModifiableSolrParams;

View File

@ -18,7 +18,7 @@
package org.apache.solr.request;
import org.apache.lucene.index.*;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.search.*;
import org.apache.lucene.util.BytesRef;
import org.apache.lucene.util.CharsRef;

View File

@ -24,7 +24,6 @@ import org.apache.lucene.search.DefaultSimilarity;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Similarity;
import org.apache.lucene.search.SimilarityProvider;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.util.Version;
import org.apache.solr.common.ResourceLoader;
import org.apache.solr.common.SolrException;

View File

@ -20,7 +20,7 @@ import org.apache.lucene.queries.function.BoostedQuery;
import org.apache.lucene.queries.function.FunctionQuery;
import org.apache.lucene.queries.function.ValueSource;
import org.apache.lucene.queries.function.valuesource.QueryValueSource;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.search.Query;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.NamedList;

View File

@ -16,8 +16,8 @@
*/
package org.apache.solr.search;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryParser.QueryParser.Operator;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.Query;
@ -59,10 +59,10 @@ public class DisMaxQParser extends QParser {
*/
public static String parseMinShouldMatch(final IndexSchema schema,
final SolrParams params) {
Operator op = QueryParsing.getQueryParserDefaultOperator
QueryParser.Operator op = QueryParsing.getQueryParserDefaultOperator
(schema, params.get(QueryParsing.OP));
return params.get(DisMaxParams.MM,
op.equals(Operator.AND) ? "100%" : "0%");
op.equals(QueryParser.Operator.AND) ? "100%" : "0%");
}
public DisMaxQParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {

View File

@ -27,8 +27,8 @@ import org.apache.lucene.queries.function.FunctionQuery;
import org.apache.lucene.queries.function.ValueSource;
import org.apache.lucene.queries.function.valuesource.ProductFloatFunction;
import org.apache.lucene.queries.function.valuesource.QueryValueSource;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryParser.QueryParser;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.*;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.TokenStream;

View File

@ -16,7 +16,7 @@
*/
package org.apache.solr.search;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.search.*;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.NamedList;

View File

@ -19,7 +19,7 @@ package org.apache.solr.search;
import org.apache.lucene.queries.function.FunctionQuery;
import org.apache.lucene.queries.function.ValueSource;
import org.apache.lucene.queries.function.valuesource.*;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.search.Query;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.request.SolrQueryRequest;

View File

@ -22,7 +22,7 @@ import org.apache.lucene.queries.function.FunctionQuery;
import org.apache.lucene.queries.function.ValueSource;
import org.apache.lucene.queries.function.ValueSourceScorer;
import org.apache.lucene.queries.function.valuesource.QueryValueSource;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.search.*;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.NamedList;

View File

@ -24,7 +24,7 @@ import org.apache.lucene.queries.function.DocValues;
import org.apache.lucene.queries.function.FunctionQuery;
import org.apache.lucene.queries.function.ValueSource;
import org.apache.lucene.queries.function.valuesource.QueryValueSource;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.search.*;
import org.apache.lucene.search.grouping.*;
import org.apache.lucene.util.BytesRef;

View File

@ -17,7 +17,7 @@
package org.apache.solr.search;
import org.apache.lucene.index.*;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.search.*;
import org.apache.lucene.util.Bits;
import org.apache.lucene.util.BytesRef;

View File

@ -16,7 +16,7 @@
*/
package org.apache.solr.search;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.Sort;
import org.apache.solr.common.SolrException;

View File

@ -17,7 +17,7 @@
package org.apache.solr.search;
import org.apache.lucene.queries.function.ValueSource;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.search.Query;
import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.NamedList;

View File

@ -17,7 +17,7 @@
package org.apache.solr.search;
import org.apache.lucene.index.Term;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.search.PrefixQuery;
import org.apache.lucene.search.Query;
import org.apache.solr.common.params.SolrParams;

View File

@ -16,7 +16,7 @@
*/
package org.apache.solr.search;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.Sort;
import org.apache.solr.common.params.CommonParams;

View File

@ -20,8 +20,8 @@ package org.apache.solr.search;
import org.apache.lucene.index.Term;
import org.apache.lucene.queries.function.FunctionQuery;
import org.apache.lucene.queries.function.valuesource.QueryValueSource;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryParser.QueryParser.Operator;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.queryparser.classic.QueryParser;
import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.ConstantScoreQuery;
@ -79,11 +79,11 @@ public class QueryParsing {
* @see IndexSchema#getQueryParserDefaultOperator()
* @see #OP
*/
public static Operator getQueryParserDefaultOperator(final IndexSchema sch,
public static QueryParser.Operator getQueryParserDefaultOperator(final IndexSchema sch,
final String override) {
String val = override;
if (null == val) val = sch.getQueryParserDefaultOperator();
return "AND".equals(val) ? Operator.AND : Operator.OR;
return "AND".equals(val) ? QueryParser.Operator.AND : QueryParser.Operator.OR;
}

View File

@ -17,7 +17,7 @@
package org.apache.solr.search;
import org.apache.lucene.index.Term;
import org.apache.lucene.queryParser.ParseException;
import org.apache.lucene.queryparser.classic.ParseException;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TermQuery;
import org.apache.solr.common.params.SolrParams;

Some files were not shown because too many files have changed in this diff Show More