You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Cassandra Targett (JIRA)" <ji...@apache.org> on 2018/02/01 17:41:00 UTC

[jira] [Updated] (SOLR-11470) Negative queries always return "No Results" with rq parameter.

     [ https://issues.apache.org/jira/browse/SOLR-11470?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Cassandra Targett updated SOLR-11470:
-------------------------------------
    Component/s: contrib - LTR

> Negative queries always return "No Results" with rq parameter.
> --------------------------------------------------------------
>
>                 Key: SOLR-11470
>                 URL: https://issues.apache.org/jira/browse/SOLR-11470
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: contrib - LTR, search
>            Reporter: Yuki Yano
>            Priority: Major
>         Attachments: SOLR-11470.patch
>
>
> h3. 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"}}.
> h3. How to reproduce
> # Prepare solr server according to [Solr Tutorial|http://lucene.apache.org/solr/guide/7_0/solr-tutorial.html].
> # Search with {{/solr/techproducts/query?q=NOT foo}}. This returns 52 documents as the result.
> # Search with {{/solr/techproducts/query?q=NOT foo&rq=\{!rerank reRankQuery=bar\}}}. This returns 0 document (52 documents are expected though...) as the result.
> h3. 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}}.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org