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

Negative queries always return "No Results" with rq parameter.

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

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: contrib - LTR, search
    • Labels:
      None

      Description

      Overview

      Negatives queries (ex. q=NOT foo) always return "No Results" with rq parameter (ex. rq={!rerank reRankQuery=bar}). This is because QueryUtils#makeQueryable doesn't consider RankQuery and fails to modify wrapped pure negative queries to searchable ones (ex. modifies q=NOT foo to q=(NOT foo) AND *:*). Pure negative queries are rewritten as MatchNoDocsQuery by BooleanQuery#rewrite and this results in numFound="0".

      How to reproduce

      1. Prepare solr server according to Solr Tutorial.
      2. Search with /solr/techproducts/query?q=NOT foo. This returns 52 documents as the result.
      3. Search with /solr/techproducts/query?q=NOT foo&rq={!rerank reRankQuery=bar}. This returns 0 document (52 documents are expected though...) as the result.

      How to fix

      Add new API RankQuery#getMainQuery to be able to get the wrapped query from RankQuery, and use it in QueryUtils#makeQueryable to fix the original query if given argument Query q is instance of RankQuery.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              yuyano Yuki Yano

              Dates

              • Created:
                Updated:

                Issue deployment