You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Munendra S N (JIRA)" <ji...@apache.org> on 2018/06/04 04:38:00 UTC
[jira] [Comment Edited] (SOLR-12069) Default operator parameter
q.op ignored.
[ https://issues.apache.org/jira/browse/SOLR-12069?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16499474#comment-16499474 ]
Munendra S N edited comment on SOLR-12069 at 6/4/18 4:37 AM:
-------------------------------------------------------------
[~cstrobl]
Facing the same issue.
From solr-7, split on whitespaces has been disabled by default(sow=false)
In Solr-6, sow=true by default
So, I tried passing sow=true in the request, the results were as expected i.e, in this can number of products are 0 and *parsedquery_toString* is *+(+inStock:T +inStock:F)*
Looks like this issue is due to change in sow default behavior
https://github.com/apache/lucene-solr/blob/master/solr/core/src/java/org/apache/solr/parser/QueryParser.java#L560 - The way the multiTerm query is handled
Also here,
https://github.com/apache/lucene-solr/blob/master/solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java#L1014 - should the operator picked from params (I didn't understand why it is always SHOULD clause)
was (Author: munendrasn):
[~cstrobl]
Facing the same issue.
From solr-7, split on whitespaces has been disabled by default(sow=false)
In Solr-6, sow=true by default
So, I tried passing sow=true in the request, the results were as expected i.e, in this can number of products are 0 and *parsedquery_toString* is *+(+inStock:T +inStock:F)*
Looks like this issue is due to change in sow default behavior
https://github.com/apache/lucene-solr/blob/master/solr/core/src/java/org/apache/solr/parser/QueryParser.java#L560 - The way the multiTerm query is handled
> Default operator parameter q.op ignored.
> ----------------------------------------
>
> Key: SOLR-12069
> URL: https://issues.apache.org/jira/browse/SOLR-12069
> Project: Solr
> Issue Type: Bug
> Security Level: Public(Default Security Level. Issues are Public)
> Components: query parsers
> Affects Versions: 7.2
> Reporter: Christoph Strobl
> Priority: Critical
>
> The {{q.op}} parameter as described in the [7.2 reference for the Standard Query Parser|http://lucene.apache.org/solr/guide/7_2/the-standard-query-parser.html#standard-query-parser-parameters] does not get used when executing a query.
> Reproduce via _techproducts_ example.
> # {{./bin/solr -e tchproducts}}
> # {{./bin/post -c techproducts example/exampledocs/*.xml}}
> # {{http "http://localhost:8983/solr/techproducts/select?q=inStock:(true false)&q.op=AND"}}
> The search above is expected to return {{0}} results but instead matches all {{21}} entries.
> The response header lists the {{q.op}} parameter
> {code:javascript}
> {
> "responseHeader": {
> "QTime": 3,
> "params": {
> "debugQuery": "on",
> "q": "inStock:(true false)",
> "q.op": "AND"
> },
> "status": 0
> },
> // ...
> }
> {code}
> The debug output is as follows:
> {code:javascript}
> debug": {
> "QParser": "LuceneQParser",
> "explain": {
> "100-435805": "\n1.5869651 = sum of:\n 1.5869651 = weight(inStock:F in 31) [SchemaSimilarity], result of:\n 1.5869651 = score(doc=31,freq=1.0 = termFreq=1.0\n), product of:\n 1.5869651 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:\n 4.0 = docFreq\n 21.0 = docCount\n 1.0 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1) from:\n 1.0 = termFreq=1.0\n 1.2 = parameter k1\n 0.0 = parameter b (norms omitted for field)\n",
> "6H500F0": "\n0.22884157 = sum of:\n 0.22884157 = weight(inStock:T in 2) [SchemaSimilarity], result of:\n 0.22884157 = score(doc=2,freq=1.0 = termFreq=1.0\n), product of:\n 0.22884157 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:\n 17.0 = docFreq\n 21.0 = docCount\n 1.0 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1) from:\n 1.0 = termFreq=1.0\n 1.2 = parameter k1\n 0.0 = parameter b (norms omitted for field)\n",
> "EN7800GTX/2DHTV/256M": "\n1.5869651 = sum of:\n 1.5869651 = weight(inStock:F in 30) [SchemaSimilarity], result of:\n 1.5869651 = score(doc=30,freq=1.0 = termFreq=1.0\n), product of:\n 1.5869651 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:\n 4.0 = docFreq\n 21.0 = docCount\n 1.0 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1) from:\n 1.0 = termFreq=1.0\n 1.2 = parameter k1\n 0.0 = parameter b (norms omitted for field)\n",
> "F8V7067-APL-KIT": "\n1.5869651 = sum of:\n 1.5869651 = weight(inStock:F in 3) [SchemaSimilarity], result of:\n 1.5869651 = score(doc=3,freq=1.0 = termFreq=1.0\n), product of:\n 1.5869651 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:\n 4.0 = docFreq\n 21.0 = docCount\n 1.0 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1) from:\n 1.0 = termFreq=1.0\n 1.2 = parameter k1\n 0.0 = parameter b (norms omitted for field)\n",
> "GB18030TEST": "\n0.22884157 = sum of:\n 0.22884157 = weight(inStock:T in 0) [SchemaSimilarity], result of:\n 0.22884157 = score(doc=0,freq=1.0 = termFreq=1.0\n), product of:\n 0.22884157 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:\n 17.0 = docFreq\n 21.0 = docCount\n 1.0 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1) from:\n 1.0 = termFreq=1.0\n 1.2 = parameter k1\n 0.0 = parameter b (norms omitted for field)\n",
> "IW-02": "\n1.5869651 = sum of:\n 1.5869651 = weight(inStock:F in 4) [SchemaSimilarity], result of:\n 1.5869651 = score(doc=4,freq=1.0 = termFreq=1.0\n), product of:\n 1.5869651 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:\n 4.0 = docFreq\n 21.0 = docCount\n 1.0 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1) from:\n 1.0 = termFreq=1.0\n 1.2 = parameter k1\n 0.0 = parameter b (norms omitted for field)\n",
> "MA147LL/A": "\n0.22884157 = sum of:\n 0.22884157 = weight(inStock:T in 5) [SchemaSimilarity], result of:\n 0.22884157 = score(doc=5,freq=1.0 = termFreq=1.0\n), product of:\n 0.22884157 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:\n 17.0 = docFreq\n 21.0 = docCount\n 1.0 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1) from:\n 1.0 = termFreq=1.0\n 1.2 = parameter k1\n 0.0 = parameter b (norms omitted for field)\n",
> "SP2514N": "\n0.22884157 = sum of:\n 0.22884157 = weight(inStock:T in 1) [SchemaSimilarity], result of:\n 0.22884157 = score(doc=1,freq=1.0 = termFreq=1.0\n), product of:\n 0.22884157 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:\n 17.0 = docFreq\n 21.0 = docCount\n 1.0 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1) from:\n 1.0 = termFreq=1.0\n 1.2 = parameter k1\n 0.0 = parameter b (norms omitted for field)\n",
> "TWINX2048-3200PRO": "\n0.22884157 = sum of:\n 0.22884157 = weight(inStock:T in 17) [SchemaSimilarity], result of:\n 0.22884157 = score(doc=17,freq=1.0 = termFreq=1.0\n), product of:\n 0.22884157 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:\n 17.0 = docFreq\n 21.0 = docCount\n 1.0 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1) from:\n 1.0 = termFreq=1.0\n 1.2 = parameter k1\n 0.0 = parameter b (norms omitted for field)\n",
> "VS1GB400C3": "\n0.22884157 = sum of:\n 0.22884157 = weight(inStock:T in 18) [SchemaSimilarity], result of:\n 0.22884157 = score(doc=18,freq=1.0 = termFreq=1.0\n), product of:\n 0.22884157 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq + 0.5)) from:\n 17.0 = docFreq\n 21.0 = docCount\n 1.0 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1) from:\n 1.0 = termFreq=1.0\n 1.2 = parameter k1\n 0.0 = parameter b (norms omitted for field)\n"
> },
> "parsedquery": "+(+(inStock:true inStock:false))",
> "parsedquery_toString": "+(+(inStock:T inStock:F))",
> "querystring": "inStock:(true false)",
> "rawquerystring": "inStock:(true false)",
> "timing": {
> // ...
> {code}
--
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