Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-5052

eDisMax Field Aliasing behaving oddly when invalid field is present

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 4.3.1
    • None
    • query parsers
    • AWS / Ubuntu

    Description

      Field Aliasing for the eDisMax query parser behaves in a very odd manner if an invalid field is specified in any of the aliases. Essentially, instead of throwing an exception on an invalid alias, it breaks all of the other aliased fields such that they will only handle the first term correctly. Take the following example:

      /select?defType=edismax&f.who.qf=personLastName_t^30 personFirstName_t^10&f.what.qf=itemName_t companyName_t^5&f.where.qf=cityName_t^10 INVALIDFIELDNAME^20 countryName_t^35 postalCodeName_t^30&q=who:(trey grainger) what:(solr) where:(atlanta, ga)&debugQuery=true&df=text

      The terms "trey", "solr" and "atlanta" correctly search across the aliased fields, but the terms "grainger" and "ga" are incorrectly being searched across the default field ("text"). Here is parsed query from the debug:

      <lst name="debug">
      <str name="rawquerystring">
      who:(trey grainger) what:(solr) where:(decatur, ga)
      </str>
      <str name="querystring">
      who:(trey grainger) what:(solr) where:(decatur, ga)
      </str>
      <str name="parsedquery">
      (+(DisjunctionMaxQuery((personFirstName_t:trey^10.0 | personLastName_t:trey^30.0)) DisjunctionMaxQuery((text:grainger)) DisjunctionMaxQuery((itemName_t:solr | companyName_t:solr^5.0)) DisjunctionMaxQuery((postalCodeName_t:decatur^30.0 | countryName_t:decatur^35.0 | cityName_t:decatur^10.0)) DisjunctionMaxQuery((text:ga))))/no_coord
      </str>
      <str name="parsedquery_toString">
      +((personFirstName_t:trey^10.0 | personLastName_t:trey^30.0) (text:grainger) (itemName_t:solr | companyName_t:solr^5.0) (postalCodeName_t:decatur^30.0 | countryName_t:decatur^35.0 | cityName_t:decatur^10.0) (text:ga))
      </str>

      I think the presence of an invalid field in a qf parameter should throw an exception (or throw the invalid field away in that alias), but it shouldn't break the aliases for other fields.

      For the record, if there are no invalid fields in any of the aliases, all of the aliases work. If there is one invalid field in any of the aliases, all of the aliases act oddly like this.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              solrtrey Trey Grainger
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: