Solr
  1. Solr
  2. SOLR-2114

hsin function doesn't properly parse when passing in multivalue sources and flag for converting to radians

    Details

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

      Description

      There is some incorrect logic when it comes to dealing with MultiValueSource and conversion to radians. See http://localhost:8983/solr/core1/select?q=_val_:%22hsin%286371.009,%20geolocation,%20vector%28-37.82,%20145.287%29,%20true%29%22 (or a similar query)

      1. SOLR-2114.patch
        5 kB
        Grant Ingersoll

        Activity

        Hide
        Grant Ingersoll added a comment -

        The exception one gets for the above query is something like:

        Caused by: org.apache.solr.common.SolrException: undefined field true
        at org.apache.solr.schema.IndexSchema.getField(IndexSchema.java:1178)
        at org.apache.solr.search.FunctionQParser.parseValueSource(FunctionQParser.java:252)
        at org.apache.solr.search.FunctionQParser.parseValueSource(FunctionQParser.java:173)
        at org.apache.solr.search.ValueSourceParser$19.parse(ValueSourceParser.java:254)
        at org.apache.solr.search.FunctionQParser.parseValueSource(FunctionQParser.java:248)
        at org.apache.solr.search.FunctionQParser.parseValueSource(FunctionQParser.java:173)
        at org.apache.solr.search.FunctionQParser.parse(FunctionQParser.java:40)
        at org.apache.solr.search.QParser.getQuery(QParser.java:137)
        at org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:86)
        at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:189)
        at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)

        Show
        Grant Ingersoll added a comment - The exception one gets for the above query is something like: Caused by: org.apache.solr.common.SolrException: undefined field true at org.apache.solr.schema.IndexSchema.getField(IndexSchema.java:1178) at org.apache.solr.search.FunctionQParser.parseValueSource(FunctionQParser.java:252) at org.apache.solr.search.FunctionQParser.parseValueSource(FunctionQParser.java:173) at org.apache.solr.search.ValueSourceParser$19.parse(ValueSourceParser.java:254) at org.apache.solr.search.FunctionQParser.parseValueSource(FunctionQParser.java:248) at org.apache.solr.search.FunctionQParser.parseValueSource(FunctionQParser.java:173) at org.apache.solr.search.FunctionQParser.parse(FunctionQParser.java:40) at org.apache.solr.search.QParser.getQuery(QParser.java:137) at org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:86) at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:189) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:131)
        Hide
        Grant Ingersoll added a comment -

        Patch to fix the problem. It reworks the parameter order slightly and makes the boolean convertToRadians flag required since the FunctionQParser does not have strong enough look ahead capabilities to be able to determine what type of argument the "next" argument is (boolean or valuesource).

        Plan on committing now.

        Show
        Grant Ingersoll added a comment - Patch to fix the problem. It reworks the parameter order slightly and makes the boolean convertToRadians flag required since the FunctionQParser does not have strong enough look ahead capabilities to be able to determine what type of argument the "next" argument is (boolean or valuesource). Plan on committing now.
        Hide
        Grant Ingersoll added a comment -

        Fixed on trunk and 3.x

        Show
        Grant Ingersoll added a comment - Fixed on trunk and 3.x
        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:
            Unassigned
            Reporter:
            Grant Ingersoll
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development