mirror of https://github.com/apache/lucene.git
SOLR-8597: add default, no-op QParserPlugin.init(NamedList) method
This commit is contained in:
parent
62c9b6a172
commit
9754da625c
|
@ -40,10 +40,6 @@ public class BoostQParserPlugin extends QParserPlugin {
|
|||
public static final String NAME = "boost";
|
||||
public static String BOOSTFUNC = "b";
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
|
||||
return new QParser(qstr, localParams, params, req) {
|
||||
|
|
|
@ -122,10 +122,6 @@ public class CollapsingQParserPlugin extends QParserPlugin {
|
|||
public static final String HINT_MULTI_DOCVALUES = "multi_docvalues";
|
||||
|
||||
|
||||
public void init(NamedList namedList) {
|
||||
|
||||
}
|
||||
|
||||
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest request) {
|
||||
return new CollapsingQParser(qstr, localParams, params, request);
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ public class ComplexPhraseQParserPlugin extends QParserPlugin {
|
|||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
super.init(args);
|
||||
if (args != null) {
|
||||
Object val = args.get("inOrder");
|
||||
if (val != null) {
|
||||
|
|
|
@ -112,10 +112,6 @@ import org.apache.solr.request.SolrQueryRequest;
|
|||
public class DisMaxQParserPlugin extends QParserPlugin {
|
||||
public static final String NAME = "dismax";
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
|
||||
return new DisMaxQParser(qstr, localParams, params, req);
|
||||
|
|
|
@ -34,9 +34,6 @@ public class ExportQParserPlugin extends QParserPlugin {
|
|||
|
||||
public static final String NAME = "xport";
|
||||
|
||||
public void init(NamedList namedList) {
|
||||
}
|
||||
|
||||
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest request) {
|
||||
return new ExportQParser(qstr, localParams, params, request);
|
||||
}
|
||||
|
|
|
@ -28,10 +28,6 @@ import org.apache.solr.request.SolrQueryRequest;
|
|||
public class ExtendedDismaxQParserPlugin extends QParserPlugin {
|
||||
public static final String NAME = "edismax";
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
|
||||
return new ExtendedDismaxQParser(qstr, localParams, params, req);
|
||||
|
|
|
@ -34,10 +34,6 @@ import org.apache.solr.schema.SchemaField;
|
|||
public class FieldQParserPlugin extends QParserPlugin {
|
||||
public static final String NAME = "field";
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
|
||||
return new QParser(qstr, localParams, params, req) {
|
||||
|
|
|
@ -28,10 +28,6 @@ import org.apache.solr.request.SolrQueryRequest;
|
|||
public class FunctionQParserPlugin extends QParserPlugin {
|
||||
public static final String NAME = "func";
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
|
||||
return new FunctionQParser(qstr, localParams, params, req);
|
||||
|
|
|
@ -38,10 +38,6 @@ import org.apache.solr.search.function.*;
|
|||
public class FunctionRangeQParserPlugin extends QParserPlugin {
|
||||
public static final String NAME = "frange";
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
|
||||
return new QParser(qstr, localParams, params, req) {
|
||||
|
|
|
@ -56,10 +56,6 @@ public class HashQParserPlugin extends QParserPlugin {
|
|||
public static final String NAME = "hash";
|
||||
|
||||
|
||||
public void init(NamedList params) {
|
||||
|
||||
}
|
||||
|
||||
public QParser createParser(String query, SolrParams localParams, SolrParams params, SolrQueryRequest request) {
|
||||
return new HashQParser(query, localParams, params, request);
|
||||
}
|
||||
|
|
|
@ -60,10 +60,6 @@ import org.apache.solr.util.RefCounted;
|
|||
public class JoinQParserPlugin extends QParserPlugin {
|
||||
public static final String NAME = "join";
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
|
||||
return new QParser(qstr, localParams, params, req) {
|
||||
|
|
|
@ -36,10 +36,6 @@ import java.util.List;
|
|||
public class LuceneQParserPlugin extends QParserPlugin {
|
||||
public static final String NAME = "lucene";
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
|
||||
return new LuceneQParser(qstr, localParams, params, req);
|
||||
|
|
|
@ -34,10 +34,6 @@ import org.apache.solr.request.SolrQueryRequest;
|
|||
public class NestedQParserPlugin extends QParserPlugin {
|
||||
public static final String NAME = "query";
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
|
||||
return new QParser(qstr, localParams, params, req) {
|
||||
|
|
|
@ -28,10 +28,6 @@ import org.apache.solr.request.SolrQueryRequest;
|
|||
public class OldLuceneQParserPlugin extends QParserPlugin {
|
||||
public static final String NAME = "lucenePlusSort";
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
|
||||
return new OldLuceneQParser(qstr, localParams, params, req);
|
||||
|
|
|
@ -34,10 +34,6 @@ import org.apache.solr.schema.SchemaField;
|
|||
public class PrefixQParserPlugin extends QParserPlugin {
|
||||
public static final String NAME = "prefix";
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
|
||||
return new QParser(qstr, localParams, params, req) {
|
||||
|
|
|
@ -82,6 +82,10 @@ public abstract class QParserPlugin implements NamedListInitializedPlugin, SolrI
|
|||
/** return a {@link QParser} */
|
||||
public abstract QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req);
|
||||
|
||||
@Override
|
||||
public void init( NamedList args ) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
// TODO: ideally use the NAME property that each qparser plugin has
|
||||
|
|
|
@ -36,10 +36,6 @@ import org.apache.solr.request.SolrQueryRequest;
|
|||
public class RawQParserPlugin extends QParserPlugin {
|
||||
public static final String NAME = "raw";
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
|
||||
return new QParser(qstr, localParams, params, req) {
|
||||
|
|
|
@ -64,9 +64,6 @@ public class ReRankQParserPlugin extends QParserPlugin {
|
|||
public static final String NAME = "rerank";
|
||||
private static Query defaultQuery = new MatchAllDocsQuery();
|
||||
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
|
||||
public QParser createParser(String query, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
|
||||
return new ReRankQParser(query, localParams, params, req);
|
||||
}
|
||||
|
|
|
@ -91,11 +91,6 @@ public class SimpleQParserPlugin extends QParserPlugin {
|
|||
OPERATORS.put(SimpleParams.NEAR_OPERATOR, SimpleQueryParser.NEAR_OPERATOR);
|
||||
}
|
||||
|
||||
/** No initialization is necessary so this method is empty. */
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
|
||||
/** Returns a QParser that will create a query by using Lucene's SimpleQueryParser. */
|
||||
@Override
|
||||
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
|
||||
|
|
|
@ -31,9 +31,4 @@ public class SpatialBoxQParserPlugin extends SpatialFilterQParserPlugin {
|
|||
return new SpatialFilterQParser(qstr, localParams, params, req, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -56,10 +56,5 @@ public class SpatialFilterQParserPlugin extends QParserPlugin {
|
|||
return new SpatialFilterQParser(qstr, localParams, params, req, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -48,10 +48,6 @@ public class SurroundQParserPlugin extends QParserPlugin {
|
|||
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
|
||||
public static final String NAME = "surround";
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public QParser createParser(String qstr, SolrParams localParams,
|
||||
SolrParams params, SolrQueryRequest req) {
|
||||
|
|
|
@ -151,10 +151,6 @@ public class SwitchQParserPlugin extends QParserPlugin {
|
|||
*/
|
||||
public static String SWITCH_DEFAULT = "default";
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
|
||||
return new QParser(qstr, localParams, params, req) {
|
||||
|
|
|
@ -43,10 +43,6 @@ import org.apache.solr.schema.FieldType;
|
|||
public class TermQParserPlugin extends QParserPlugin {
|
||||
public static final String NAME = "term";
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
|
||||
return new QParser(qstr, localParams, params, req) {
|
||||
|
|
|
@ -58,10 +58,6 @@ public class TermsQParserPlugin extends QParserPlugin {
|
|||
/** Choose the internal algorithm */
|
||||
private static final String METHOD = "method";
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
|
||||
private static enum Method {
|
||||
termsFilter {
|
||||
@Override
|
||||
|
|
|
@ -58,10 +58,6 @@ public class XmlQParserPlugin extends QParserPlugin {
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
|
||||
public QParser createParser(String qstr, SolrParams localParams,
|
||||
SolrParams params, SolrQueryRequest req) {
|
||||
return new XmlQParser(qstr, localParams, params, req);
|
||||
|
|
|
@ -41,9 +41,5 @@ public class BlockJoinParentQParserPlugin extends QParserPlugin {
|
|||
protected QParser createBJQParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
|
||||
return new BlockJoinParentQParser(qstr, localParams, params, req);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,10 +31,6 @@ public class GraphQParserPlugin extends QParserPlugin {
|
|||
// Graph Query Parser parser name
|
||||
public static final String NAME = "graph";
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
|
||||
// return the graph query parser for this request.
|
||||
|
|
|
@ -206,10 +206,6 @@ public class ScoreJoinQParserPlugin extends QParserPlugin {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
|
||||
|
|
|
@ -28,11 +28,6 @@ import org.apache.solr.search.QParserPlugin;
|
|||
public class MLTQParserPlugin extends QParserPlugin {
|
||||
public static final String NAME = "mlt";
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public QParser createParser(String qstr, SolrParams localParams,
|
||||
SolrParams params, SolrQueryRequest req) {
|
||||
|
|
|
@ -30,10 +30,6 @@ public class FooQParserPlugin extends QParserPlugin {
|
|||
public QParser createParser(String qstr, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
|
||||
return new FooQParser(qstr, localParams, params, req);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(NamedList args) {
|
||||
}
|
||||
}
|
||||
|
||||
class FooQParser extends QParser {
|
||||
|
|
|
@ -41,10 +41,6 @@ import java.io.IOException;
|
|||
public class TestAnalyticsQParserPlugin extends QParserPlugin {
|
||||
|
||||
|
||||
public void init(NamedList params) {
|
||||
|
||||
}
|
||||
|
||||
public QParser createParser(String query, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
|
||||
return new TestAnalyticsQueryParser(query, localParams, params, req);
|
||||
}
|
||||
|
|
|
@ -72,10 +72,6 @@ import org.junit.Ignore;
|
|||
public class TestRankQueryPlugin extends QParserPlugin {
|
||||
|
||||
|
||||
public void init(NamedList params) {
|
||||
|
||||
}
|
||||
|
||||
public QParser createParser(String query, SolrParams localParams, SolrParams params, SolrQueryRequest req) {
|
||||
return new TestRankQueryParser(query, localParams, params, req);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue