You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Yonik Seeley (JIRA)" <ji...@apache.org> on 2018/04/12 14:00:00 UTC

[jira] [Comment Edited] (SOLR-10442) xtendedDismaxQParser (edismax) makes pf* require search term exactly

    [ https://issues.apache.org/jira/browse/SOLR-10442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435619#comment-16435619 ] 

Yonik Seeley edited comment on SOLR-10442 at 4/12/18 1:59 PM:
--------------------------------------------------------------

I was able to replicate the query structure you are seeing:
http://localhost:8983/solr/books/select?q={!edismax}storm%20swords&qf=title&pf2=title&debugQuery=true&q.op=AND

{code}
+(+DisjunctionMaxQuery((title:storm)) +DisjunctionMaxQuery((title:swords))) (+DisjunctionMaxQuery((title:"storm swords")))

+(+(title:storm) +(title:swords)) (+(title:"storm swords"))
{code}

Note that the mandatory title:"storm swords" is wrapped in another boolean query that is not mandatory.  The response contains the book even though that clause does not match:
{code}
  "response":{"numFound":1,"start":0,"maxScore":2.6367342,"docs":[
      {
        "id":"book1",
        "cat":["fantasy"],
        "pubyear_i":2000,
        "title":["A Storm of Swords"],
        "author":["George R.R. Martin"],
        "series_s":"A Song of Ice and Fire",
        "sequence_i":3,
        "title_str":["A Storm of Swords"],
        "author_str":["George R.R. Martin"],
        "_version_":1597546958994538496,
        "cat_str":["fantasy"]}]
  },
{code}

Are you sure this is causing some documents to not match that were previously matching?


was (Author: yseeley@gmail.com):
I was able to replicate the query structure you are seeing:
http://localhost:8983/solr/books/select?q={!edismax}storm%20swords&qf=title&pf2=title&debugQuery=true&q.op=AND

{code}
+(+DisjunctionMaxQuery((title:storm)) +DisjunctionMaxQuery((title:swords))) (+DisjunctionMaxQuery((title:"storm swords")))
+(+(title:storm) +(title:swords)) (+(title:"storm swords"))
{code}

Note that the mandatory title:"storm swords" is wrapped in another boolean query that is not mandatory.  The response contains the book even though that clause does not match:
{code}
  "response":{"numFound":1,"start":0,"maxScore":2.6367342,"docs":[
      {
        "id":"book1",
        "cat":["fantasy"],
        "pubyear_i":2000,
        "title":["A Storm of Swords"],
        "author":["George R.R. Martin"],
        "series_s":"A Song of Ice and Fire",
        "sequence_i":3,
        "title_str":["A Storm of Swords"],
        "author_str":["George R.R. Martin"],
        "_version_":1597546958994538496,
        "cat_str":["fantasy"]}]
  },
{code}

Are you sure this is causing some documents to not match that were previously matching?

> xtendedDismaxQParser (edismax) makes pf* require search term exactly
> --------------------------------------------------------------------
>
>                 Key: SOLR-10442
>                 URL: https://issues.apache.org/jira/browse/SOLR-10442
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: query parsers
>    Affects Versions: 6.5
>            Reporter: Nikolay Martynov
>            Priority: Major
>
> Request like:
> {code}
>     "params":{
>       "q": "cat AND dog",
>       "q.op": "AND",
>       "defType":"edismax",
>       "qf":"description",
>       "pf2":"description"
> }
> {code}
> produces query like this:
> {code}
> "parsedquery_toString":"+(+(description.en:cat) +(description.en:dog)) (+(description.en:\"cat dog\"))"
> {code}
> Solr 4.6.1 produces different parsing of this query:
> {code}
> "parsedquery_toString": "+(+(description.en:cat) +(description.en:dog)) (description.en:\"cat dog\")",
> {code}
> Replacing {{q.op=AND}} with {{q.op=OR}} in newer Solr produces same query as old Solr despite the fact that it would seem that this change should not make a difference.
> This issue is probably related to SOLR-8812 - looks like it is just one more case of same problem. It also would mean that change occurred in version range specified there - unfortunately I would not be able to test that.
> This looks like a change in behaviour is not quite expected: now introducing pf2 searches for documents that must have 'cat dog' phrase instead of just boosting such documents.
> Please let me know if more information is required.



--
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