Description
SOLR-839 added XML QueryParser support (deftype=xmlparser) and this ticket here proposes to make that support extensible-via-configuration.
Objective:
- To support use of custom query builders.
- To support use of custom query builders without a corresponding custom XmlQParser plugin class.
Illustration:
- solrconfig.xml snippet to configure use of the custom builders
<queryParser name="testxmlparser" class="XmlQParserPlugin"> <str name="HelloQuery">org.apache.solr.search.HelloQueryBuilder</str> <str name="GoodbyeQuery">org.apache.solr.search.GoodbyeQueryBuilder</str> </queryParser>
- HelloQueryBuilder and GoodbyeQueryBuilder both extend the new abstract SolrQueryBuilder class.
+ public abstract class SolrQueryBuilder implements QueryBuilder { + protected final SolrQueryRequest req; + protected final QueryBuilder queryFactory; + public SolrQueryBuilder(String defaultField, Analyzer analyzer, + SolrQueryRequest req, QueryBuilder queryFactory) { + this.req = req; + this.queryFactory = queryFactory; + } + }