Solr
  1. Solr
  2. SOLR-4093

localParams syntax for standard query parser

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.1
    • Component/s: None
    • Labels:
      None

      Description

      Instead of

      _query_:"{!geodist d=10 p=20.5,30.2}"
      

      one could directly use

      {!geodist d=10 p=20.5,30.2}
       

      references: http://wiki.apache.org/solr/LocalParams

      First raised as LUCENE-4271, but moved to this Solr issue due to concerns about Solr specific features in Lucene.

      1. SOLR-4093.patch
        229 kB
        Yonik Seeley

        Issue Links

          Activity

          Hide
          Yonik Seeley added a comment -

          Here's a patch that adds a Solr specific parser under o.a.s.parser and implements the localParams functionality.

          I've also used this opportunity to migrate from ParseException to SyntaxError in the bulk of Solr code - we shouldn't be relying on an implementation detail of one parser for what should be a generic exception.

          Show
          Yonik Seeley added a comment - Here's a patch that adds a Solr specific parser under o.a.s.parser and implements the localParams functionality. I've also used this opportunity to migrate from ParseException to SyntaxError in the bulk of Solr code - we shouldn't be relying on an implementation detail of one parser for what should be a generic exception.
          Hide
          David Smiley added a comment - - edited

          Nice! It'll be good to see the old _query_ hack gone.

          Curious; how did you come up with the JavaCC parser? Did you copy and modify it from Lucene's?

          Show
          David Smiley added a comment - - edited Nice! It'll be good to see the old _query_ hack gone. Curious; how did you come up with the JavaCC parser? Did you copy and modify it from Lucene's?
          Hide
          Yonik Seeley added a comment -

          Curious; how did you come up with the JavaCC parser? Did you copy and modify it from Lucene's?

          Yep, and modified the grammar to slurp a localParams block as one big token.
          I should be able to further simplify some of the parser by cutting out the cruft Solr never needed since it drives from the schema.

          Show
          Yonik Seeley added a comment - Curious; how did you come up with the JavaCC parser? Did you copy and modify it from Lucene's? Yep, and modified the grammar to slurp a localParams block as one big token. I should be able to further simplify some of the parser by cutting out the cruft Solr never needed since it drives from the schema.
          Hide
          Commit Tag Bot added a comment -

          [branch_4x commit] Yonik Seeley
          http://svn.apache.org/viewvc?view=revision&revision=1413047

          SOLR-4093: solr specific parser + localParams syntax

          Show
          Commit Tag Bot added a comment - [branch_4x commit] Yonik Seeley http://svn.apache.org/viewvc?view=revision&revision=1413047 SOLR-4093 : solr specific parser + localParams syntax
          Hide
          Commit Tag Bot added a comment -

          [trunk commit] Yonik Seeley
          http://svn.apache.org/viewvc?view=revision&revision=1413042

          SOLR-4093: solr specific parser + localParams syntax

          Show
          Commit Tag Bot added a comment - [trunk commit] Yonik Seeley http://svn.apache.org/viewvc?view=revision&revision=1413042 SOLR-4093 : solr specific parser + localParams syntax
          Hide
          Commit Tag Bot added a comment -

          [branch_4x commit] Yonik Seeley
          http://svn.apache.org/viewvc?view=revision&revision=1413047

          SOLR-4093: solr specific parser + localParams syntax

          Show
          Commit Tag Bot added a comment - [branch_4x commit] Yonik Seeley http://svn.apache.org/viewvc?view=revision&revision=1413047 SOLR-4093 : solr specific parser + localParams syntax

            People

            • Assignee:
              Unassigned
              Reporter:
              Yonik Seeley
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development