Solr
  1. Solr
  2. SOLR-2133

ability to parse multiple value sources

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.1, 4.0-ALPHA
    • Component/s: None
    • Labels:
      None

      Description

      To enable things like this:
      q=dist($pt)&pt=10,20
      The function query parser needs to have the option of parsing a list of value sources rather than just one.

      1. SOLR-2133.patch
        4 kB
        Yonik Seeley
      2. SOLR-2133.patch
        3 kB
        Yonik Seeley

        Activity

        Hide
        Yonik Seeley added a comment -

        Related: we should throw an exception if there is unexpected trailing stuff after parsing a value source.
        For example, today a query of defType=func&q=10,20 parses the 10 and silently ignores the rest.

        The behavior to parse multiple until the end of the string needs to be optional and configurable so we can only do it during parsing of sub-value sources. If multiple value sources are parsed, they would presumably be returned as a VectorValueSource.

        Show
        Yonik Seeley added a comment - Related: we should throw an exception if there is unexpected trailing stuff after parsing a value source. For example, today a query of defType=func&q=10,20 parses the 10 and silently ignores the rest. The behavior to parse multiple until the end of the string needs to be optional and configurable so we can only do it during parsing of sub-value sources. If multiple value sources are parsed, they would presumably be returned as a VectorValueSource.
        Hide
        Yonik Seeley added a comment -

        Here's a patch that seems to work fine.
        A query like:
        defType=func&q=10 what?
        now produces an error like:
        org.apache.lucene.queryParser.ParseException: Unexpected text after function: what?

        And a query like:
        q=dist(2,vector(1,2),vector(3,4))
        is equivalent to
        q=dist(2,vector(1,2),$pt)&pt=3,4

        Which will make it a lot more user friendly to deal with referencing points in spatial search like
        pt=lat,lon

        I'll add some tests next.

        Show
        Yonik Seeley added a comment - Here's a patch that seems to work fine. A query like: defType=func&q=10 what? now produces an error like: org.apache.lucene.queryParser.ParseException: Unexpected text after function: what? And a query like: q=dist(2,vector(1,2),vector(3,4)) is equivalent to q=dist(2,vector(1,2),$pt)&pt=3,4 Which will make it a lot more user friendly to deal with referencing points in spatial search like pt=lat,lon I'll add some tests next.
        Hide
        Yonik Seeley added a comment -

        And here's the patch w/ tests.

        Show
        Yonik Seeley added a comment - And here's the patch w/ tests.
        Hide
        Yonik Seeley added a comment -

        committed.

        Show
        Yonik Seeley added a comment - committed.
        Hide
        Koji Sekiguchi added a comment -

        Reopening to incorporate this into 3x.

        Show
        Koji Sekiguchi added a comment - Reopening to incorporate this into 3x.
        Hide
        Koji Sekiguchi added a comment -

        branch_3x: Committed revision 1003741.

        Show
        Koji Sekiguchi added a comment - branch_3x: Committed revision 1003741.
        Hide
        Grant Ingersoll added a comment -

        Bulk close for 3.1.0 release

        Show
        Grant Ingersoll added a comment - Bulk close for 3.1.0 release

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development