Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-9275

make XML Query Parser support extensible-via-configuration

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.6, 6.2, 7.0
    • Component/s: None
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None

      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;
        +   }
        + }
        

        Attachments

        1. SOLR-9275.patch
          17 kB
          Christine Poerschke

          Issue Links

            Activity

              People

              • Assignee:
                cpoerschke Christine Poerschke
                Reporter:
                cpoerschke Christine Poerschke
              • Votes:
                1 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: