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

Phrase matching on boolean queries

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • query parsers

    Description

      Using the eDismax Query Parser, if a query has boolean clauses, phrase matches are done on entire query rather than the sub queries created by the boolean operators.
       
      Eg:
      Query - 
          (gear AND cycle) OR (black AND cycle)
       
      The parsed query for this is 
       
          "(((query:gear) + (query:cycle)) (+(query:black) + (query:cycle))) (phrase:\"gear cycle black cycle\")"
       
      As can be seen the query conditions are as expected but I want the phrase match on "gear cycle" or "black cycle" .
       
      Using boost/bq will not solve the use case because I also want to define phrase slop. So that a phrase match for "black cycle" will match documents like "black colour cycle".
       
      Possible Solutions - 
      1. Apply the phrase match on the individual queries produced
      2. Apply the phrase match on a different attribute than 'q'. As a workaround users can create the individual phrases to be matched and supply that to this attribute.

      Attachments

        Activity

          People

            Unassigned Unassigned
            krishan1390 Krishan Goyal
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: