Solr
  1. Solr
  2. SOLR-2031

QueryComponent's default query parser should be configurable from solrconfig.xml

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Not a Problem
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None

      Description

      In a multi-lucene-query environment, QueryComponent's way of selecting a default query parser must include solrconfig.xml support to be useful. It can't just get the default query parser from the request arguments.

      1. SOLR-2031.patch
        1 kB
        Karl Wright
      2. SOLR-2031.patch
        1 kB
        Simon Willnauer
      3. SOLR-2031.patch
        1 kB
        Simon Willnauer

        Issue Links

          Activity

          Hide
          Karl Wright added a comment -

          A patch which allows a solrconfig.xml specification of the default query parser. The XML would look something like this:

          <searchComponent name="myquery" class="org.apache.solr.handler.component.QueryComponent">
          <str name="defType">myqueryparser</str>
          </searchComponent>

          Show
          Karl Wright added a comment - A patch which allows a solrconfig.xml specification of the default query parser. The XML would look something like this: <searchComponent name="myquery" class="org.apache.solr.handler.component.QueryComponent"> <str name="defType">myqueryparser</str> </searchComponent>
          Hide
          Mark Miller added a comment - - edited

          It can't just get the default query parser from the request arguments.

          Why is that? Why can't you just set the default at the request handler level?

          <requestHandler name="dismax" class="solr.SearchHandler" >
              <lst name="defaults">
               <str name="defType">myqueryparser</str>
          
          Show
          Mark Miller added a comment - - edited It can't just get the default query parser from the request arguments. Why is that? Why can't you just set the default at the request handler level? <requestHandler name= "dismax" class= "solr.SearchHandler" > <lst name= "defaults" > <str name= "defType" >myqueryparser</str>
          Hide
          Karl Wright added a comment -

          The reason is that I may be (will be) using the same search component in two different contexts within the SAME request. So the request handler override is not going to help.

          See SOLR-2026 for a high-level description of why I need to do this.

          Show
          Karl Wright added a comment - The reason is that I may be (will be) using the same search component in two different contexts within the SAME request. So the request handler override is not going to help. See SOLR-2026 for a high-level description of why I need to do this.
          Hide
          Simon Willnauer added a comment -

          I updated the patch to use initialize the default parser with the QParserPlugin.DEFAULT_QTYPE default type in the init method. Safes us another conditional statement and is cleaner IMO

          Mark - any objections with this issue?

          Show
          Simon Willnauer added a comment - I updated the patch to use initialize the default parser with the QParserPlugin.DEFAULT_QTYPE default type in the init method. Safes us another conditional statement and is cleaner IMO Mark - any objections with this issue?
          Hide
          Simon Willnauer added a comment -

          updated patch to trunk - if nobody objects I'd commit that in a day or two

          Show
          Simon Willnauer added a comment - updated patch to trunk - if nobody objects I'd commit that in a day or two
          Hide
          Simon Willnauer added a comment -

          after all this doesn't seem to be really needed

          Show
          Simon Willnauer added a comment - after all this doesn't seem to be really needed

            People

            • Assignee:
              Simon Willnauer
              Reporter:
              Karl Wright
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development