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

Edismax field alias bug

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

      Description

      If you create a field alias that maps to a nonexistent field, the query will be parsed to utter garbage.

      The bug can reproduced very easily. Add the following line to the /browse request handler in the tutorial example solrconfig.xml
      <str name="f.name_features.qf">name features XXX</str>
      (XXX is a nonexistent field)

      This simple query will actually work correctly:
      name_features:video
      and it will be parsed to (features:video | name:video) and return 3 results. It has simply discarded the nonexistent field and the result set is correct.
      However if you change the query to:
      name_features:video AND name_features:video
      you will now get 0 result and the query is parsed to
      +(((features:video | name:video) (id:AND^10.0 | author:and^2.0 | title:and^10.0 | cat:AND^1.4 | text:and^0.5 | keywords:and^5.0 | manu:and^1.1 | description:and^5.0 | resourcename:and | name:and^1.2 | features:and) (features:video | name:video))~3)
      Notice the AND operator is now used a term! The parsed query can turn out even worse and produce query parts such as:
      title:2~2
      title:and^2.0^10.0

      Prefered solution: During start up, shut down Solr if there is a nonexistant field alias. Just as is the case if the cycle-detection detects a cycle:
      Acceptable solution: Ignore the nonexistant field totally.

      Thomas Egense

        Attachments

        1. SOLR-6376.patch
          3 kB
          Vitaliy Zhovtyuk
        2. SOLR-6376.patch
          2 kB
          Vitaliy Zhovtyuk

        Issue Links

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              thomas_egense Thomas Egense

              Dates

              • Created:
                Updated:

                Issue deployment