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, master (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;
        +   }
        + }
        
      1. SOLR-9275.patch
        17 kB
        Christine Poerschke

        Issue Links

          Activity

          Hide
          cpoerschke Christine Poerschke added a comment -

          Attaching proposed patch against master branch.

          Show
          cpoerschke Christine Poerschke added a comment - Attaching proposed patch against master branch.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 9f13bf671872d973684fe77e36373e9136645c48 in lucene-solr's branch refs/heads/master from Christine Poerschke
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=9f13bf6 ]

          SOLR-9275: add defaultField protected field to queryparser/xml's CoreParser

          Show
          jira-bot ASF subversion and git services added a comment - Commit 9f13bf671872d973684fe77e36373e9136645c48 in lucene-solr's branch refs/heads/master from Christine Poerschke [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=9f13bf6 ] SOLR-9275 : add defaultField protected field to queryparser/xml's CoreParser
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 6f76ac1314510fe09860a92e246c88bfae168fbb in lucene-solr's branch refs/heads/master from Christine Poerschke
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=6f76ac1 ]

          SOLR-9275: make XML QueryParser support (defType=xmlparser) extensible via configuration

          Show
          jira-bot ASF subversion and git services added a comment - Commit 6f76ac1314510fe09860a92e246c88bfae168fbb in lucene-solr's branch refs/heads/master from Christine Poerschke [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=6f76ac1 ] SOLR-9275 : make XML QueryParser support (defType=xmlparser) extensible via configuration
          Hide
          cpoerschke Christine Poerschke added a comment -

          Change committed to master and would be cherry-picking to branches in a few days or so.

          Show
          cpoerschke Christine Poerschke added a comment - Change committed to master and would be cherry-picking to branches in a few days or so.
          Hide
          hossman Hoss Man added a comment -

          Christine Poerschke: suspiciously timed NPEs in xml parser related tests on master...

          http://jenkins.thetaphi.de/job/Lucene-Solr-master-Solaris/725/

          FAILED:  org.apache.solr.search.QueryEqualityTest.testMatchAllDocsQueryXmlParser
          
          Error Message:
          
          Stack Trace:
          java.lang.NullPointerException
                  at __randomizedtesting.SeedInfo.seed([906E24691016A761:855CC3EB430065FB]:0)
                  at org.apache.solr.search.SolrCoreParser.init(SolrCoreParser.java:54)
                  at org.apache.solr.search.XmlQParserPlugin$XmlQParser.parse(XmlQParserPlugin.java:60)
                  at org.apache.solr.search.QParser.getQuery(QParser.java:140)
                  at org.apache.solr.search.QueryEqualityTest.assertQueryEquals(QueryEqualityTest.java:1013)
                  at org.apache.solr.search.QueryEqualityTest.assertQueryEquals(QueryEqualityTest.java:987)
                  at org.apache.solr.search.QueryEqualityTest.testMatchAllDocsQueryXmlParser(QueryEqualityTest.java:204)
          

          A seed i just encountered locally...

             [junit4]   2> NOTE: reproduce with: ant test  -Dtestcase=QueryEqualityTest -Dtests.method=testMatchAllDocsQueryXmlParser -Dtests.seed=8C6EA92C29E18E82 -Dtests.slow=true -Dtests.locale=lt -Dtests.timezone=Australia/Lindeman -Dtests.asserts=true -Dtests.file.encoding=ISO-8859-1
             [junit4] ERROR   0.04s J1 | QueryEqualityTest.testMatchAllDocsQueryXmlParser <<<
             [junit4]    > Throwable #1: java.lang.NullPointerException
             [junit4]    > 	at __randomizedtesting.SeedInfo.seed([8C6EA92C29E18E82:995C4EAE7AF74C18]:0)
             [junit4]    > 	at org.apache.solr.search.SolrCoreParser.init(SolrCoreParser.java:54)
             [junit4]    > 	at org.apache.solr.search.XmlQParserPlugin$XmlQParser.parse(XmlQParserPlugin.java:60)
             [junit4]    > 	at org.apache.solr.search.QParser.getQuery(QParser.java:140)
             [junit4]    > 	at org.apache.solr.search.QueryEqualityTest.assertQueryEquals(QueryEqualityTest.java:1013)
             [junit4]    > 	at org.apache.solr.search.QueryEqualityTest.assertQueryEquals(QueryEqualityTest.java:987)
             [junit4]    > 	at org.apache.solr.search.QueryEqualityTest.testMatchAllDocsQueryXmlParser(QueryEqualityTest.java:204)
             [junit4]    > 	at java.lang.Thread.run(Thread.java:745)
          
          Show
          hossman Hoss Man added a comment - Christine Poerschke : suspiciously timed NPEs in xml parser related tests on master... http://jenkins.thetaphi.de/job/Lucene-Solr-master-Solaris/725/ FAILED: org.apache.solr.search.QueryEqualityTest.testMatchAllDocsQueryXmlParser Error Message: Stack Trace: java.lang.NullPointerException at __randomizedtesting.SeedInfo.seed([906E24691016A761:855CC3EB430065FB]:0) at org.apache.solr.search.SolrCoreParser.init(SolrCoreParser.java:54) at org.apache.solr.search.XmlQParserPlugin$XmlQParser.parse(XmlQParserPlugin.java:60) at org.apache.solr.search.QParser.getQuery(QParser.java:140) at org.apache.solr.search.QueryEqualityTest.assertQueryEquals(QueryEqualityTest.java:1013) at org.apache.solr.search.QueryEqualityTest.assertQueryEquals(QueryEqualityTest.java:987) at org.apache.solr.search.QueryEqualityTest.testMatchAllDocsQueryXmlParser(QueryEqualityTest.java:204) A seed i just encountered locally... [junit4] 2> NOTE: reproduce with: ant test -Dtestcase=QueryEqualityTest -Dtests.method=testMatchAllDocsQueryXmlParser -Dtests.seed=8C6EA92C29E18E82 -Dtests.slow=true -Dtests.locale=lt -Dtests.timezone=Australia/Lindeman -Dtests.asserts=true -Dtests.file.encoding=ISO-8859-1 [junit4] ERROR 0.04s J1 | QueryEqualityTest.testMatchAllDocsQueryXmlParser <<< [junit4] > Throwable #1: java.lang.NullPointerException [junit4] > at __randomizedtesting.SeedInfo.seed([8C6EA92C29E18E82:995C4EAE7AF74C18]:0) [junit4] > at org.apache.solr.search.SolrCoreParser.init(SolrCoreParser.java:54) [junit4] > at org.apache.solr.search.XmlQParserPlugin$XmlQParser.parse(XmlQParserPlugin.java:60) [junit4] > at org.apache.solr.search.QParser.getQuery(QParser.java:140) [junit4] > at org.apache.solr.search.QueryEqualityTest.assertQueryEquals(QueryEqualityTest.java:1013) [junit4] > at org.apache.solr.search.QueryEqualityTest.assertQueryEquals(QueryEqualityTest.java:987) [junit4] > at org.apache.solr.search.QueryEqualityTest.testMatchAllDocsQueryXmlParser(QueryEqualityTest.java:204) [junit4] > at java.lang.Thread.run(Thread.java:745)
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 832dacffc8dddfef07456624660118a593f176bd in lucene-solr's branch refs/heads/master from Christine Poerschke
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=832dacf ]

          SOLR-9275: fix NPE in SolrCoreParser.init

          Show
          jira-bot ASF subversion and git services added a comment - Commit 832dacffc8dddfef07456624660118a593f176bd in lucene-solr's branch refs/heads/master from Christine Poerschke [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=832dacf ] SOLR-9275 : fix NPE in SolrCoreParser.init
          Hide
          cpoerschke Christine Poerschke added a comment -

          Apologies, i should have run all tests before committing. Fix committed (init for the plugin is not always called and even if it is called then null args would be a possibility).

          Show
          cpoerschke Christine Poerschke added a comment - Apologies, i should have run all tests before committing. Fix committed (init for the plugin is not always called and even if it is called then null args would be a possibility).
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 80a2e73ccd8498b4714347268987a042867cd65f in lucene-solr's branch refs/heads/branch_6x from Christine Poerschke
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=80a2e73 ]

          SOLR-9275: make XML QueryParser support (defType=xmlparser) extensible via configuration

          Show
          jira-bot ASF subversion and git services added a comment - Commit 80a2e73ccd8498b4714347268987a042867cd65f in lucene-solr's branch refs/heads/branch_6x from Christine Poerschke [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=80a2e73 ] SOLR-9275 : make XML QueryParser support (defType=xmlparser) extensible via configuration
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit a4970c8685899d1262320b056992874dd672a40f in lucene-solr's branch refs/heads/branch_6x from Christine Poerschke
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=a4970c8 ]

          SOLR-9275: fix NPE in SolrCoreParser.init

          Show
          jira-bot ASF subversion and git services added a comment - Commit a4970c8685899d1262320b056992874dd672a40f in lucene-solr's branch refs/heads/branch_6x from Christine Poerschke [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=a4970c8 ] SOLR-9275 : fix NPE in SolrCoreParser.init
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit d9dcd5a0758b3526e08393b77b8a48adfedbf5a4 in lucene-solr's branch refs/heads/branch_5x from Christine Poerschke
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=d9dcd5a ]

          SOLR-9275: add defaultField protected field to queryparser/xml's CoreParser

          Show
          jira-bot ASF subversion and git services added a comment - Commit d9dcd5a0758b3526e08393b77b8a48adfedbf5a4 in lucene-solr's branch refs/heads/branch_5x from Christine Poerschke [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=d9dcd5a ] SOLR-9275 : add defaultField protected field to queryparser/xml's CoreParser
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 03eb44ad121777f38d97f40862ab03b71207a5df in lucene-solr's branch refs/heads/branch_5x from Christine Poerschke
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=03eb44a ]

          SOLR-9275: make XML QueryParser support (defType=xmlparser) extensible via configuration

          Show
          jira-bot ASF subversion and git services added a comment - Commit 03eb44ad121777f38d97f40862ab03b71207a5df in lucene-solr's branch refs/heads/branch_5x from Christine Poerschke [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=03eb44a ] SOLR-9275 : make XML QueryParser support (defType=xmlparser) extensible via configuration
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit bb2f70eabf3fcb63662b3580936dbce6c7df1449 in lucene-solr's branch refs/heads/branch_5x from Christine Poerschke
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=bb2f70e ]

          SOLR-9275: fix NPE in SolrCoreParser.init

          Show
          jira-bot ASF subversion and git services added a comment - Commit bb2f70eabf3fcb63662b3580936dbce6c7df1449 in lucene-solr's branch refs/heads/branch_5x from Christine Poerschke [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=bb2f70e ] SOLR-9275 : fix NPE in SolrCoreParser.init
          Hide
          mikemccand Michael McCandless added a comment -

          Bulk close resolved issues after 6.2.0 release.

          Show
          mikemccand Michael McCandless added a comment - Bulk close resolved issues after 6.2.0 release.
          Show
          cpoerschke Christine Poerschke added a comment - Draft entry for Solr Ref Guide added at https://cwiki.apache.org/confluence/display/solr/Other+Parsers#OtherParsers-XMLQueryParser

            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:

                Development