[
https://issues.apache.org/jira/browse/SOLR-5949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13958315#comment-13958315
]
Hoss Man commented on SOLR-5949:
--------------------------------
Bob: based on the information you've provided here, there is not enough
info/evidence to reproduce the problem you are describing (in either 4.3.1, or
4.7.1).
Please post a question to the solr-user list, and provide all of the details
about what your configuration looks like (schema.xml and solrconfig.xml), what
your data looks like, and what exactly your requests look like including what
debugQuery output you get. In general, you should always send questions like
this to the mailing list, which is the primary forum for seeking help, and only
file a Jira issue for a Bug once there is reproducible confirmation (or if
requested by a dev -- sometimes even if folks can't reproduce it's helpful to
create a jira to track it and upload detailed logs.)
----
My best off the cuff guesses, are that either you are using a phrase query even
though you don't realize it, or that you have an edismax configuration that
results in a query clause being created for your "no" word even though you
think it's a stopword -- ie becuase of how your qf fields are configured. In
any case, as mentioned before, the mailing list is the appropriate forum to
ask/discuss these problems.
----
Steps attempted to reproduce, using both the lucene QParser and edismax parser
against the example configs provided in Solr 4.3.1 and Solr 4.7.1 ({{\*_en}}
uses stopwords_en.txt containing "no" in both caes)...
{noformat}
$ curl -H 'Content-Type: application/json' -d '[{"id":"1","text_en":"No Smoking
Sign"}]' 'http://localhost:8983/solr/collection1/update?commit=true'
{"responseHeader":{"status":0,"QTime":560}}
$ curl -sS
'http://localhost:8983/solr/collection1/select?debugQuery=true&wt=json&indent=true&defType=lucene&q=text_en:(No+AND+Smoking+AND+Sign)'
{
"responseHeader":{
"status":0,
"QTime":4,
"params":{
"debugQuery":"true",
"indent":"true",
"q":"text_en:(No AND Smoking AND Sign)",
"wt":"json",
"defType":"lucene"}},
"response":{"numFound":1,"start":0,"docs":[
{
"id":"1",
"text_en":["No Smoking Sign"],
"_version_":1464315067874934784}]
},
"debug":{
"rawquerystring":"text_en:(No AND Smoking AND Sign)",
"querystring":"text_en:(No AND Smoking AND Sign)",
"parsedquery":"+text_en:smoke +text_en:sign",
"parsedquery_toString":"+text_en:smoke +text_en:sign",
...
$ curl -sS
'http://localhost:8983/solr/collection1/select?debugQuery=true&wt=json&indent=true&defType=edismax&q=text_en:(No+AND+Smoking+AND+Sign)'
{
"responseHeader":{
"status":0,
"QTime":7,
"params":{
"debugQuery":"true",
"indent":"true",
"q":"text_en:(No AND Smoking AND Sign)",
"wt":"json",
"defType":"edismax"}},
"response":{"numFound":1,"start":0,"docs":[
{
"id":"1",
"text_en":["No Smoking Sign"],
"_version_":1464315067874934784}]
},
"debug":{
"rawquerystring":"text_en:(No AND Smoking AND Sign)",
"querystring":"text_en:(No AND Smoking AND Sign)",
"parsedquery":"(+(+text_en:smoke +text_en:sign))/no_coord",
"parsedquery_toString":"+(+text_en:smoke +text_en:sign)",
$ curl -sS
'http://localhost:8983/solr/collection1/select?debugQuery=true&wt=json&indent=true&defType=edismax&qf=text_en&q=No+AND+Smoking+AND+Sign'
{
"responseHeader":{
"status":0,
"QTime":7,
"params":{
"debugQuery":"true",
"indent":"true",
"q":"No AND Smoking AND Sign",
"qf":"text_en",
"wt":"json",
"defType":"edismax"}},
"response":{"numFound":1,"start":0,"docs":[
{
"id":"1",
"text_en":["No Smoking Sign"],
"_version_":1464315067874934784}]
},
"debug":{
"rawquerystring":"No AND Smoking AND Sign",
"querystring":"No AND Smoking AND Sign",
"parsedquery":"(+(+DisjunctionMaxQuery((text_en:smoke))
+DisjunctionMaxQuery((text_en:sign))))/no_coord",
"parsedquery_toString":"+(+(text_en:smoke) +(text_en:sign))",
{noformat}
> Stopwords in Boolean Query Result in invalid query
> --------------------------------------------------
>
> Key: SOLR-5949
> URL: https://issues.apache.org/jira/browse/SOLR-5949
> Project: Solr
> Issue Type: Bug
> Components: query parsers
> Affects Versions: 4.3
> Environment: Linux
> Reporter: Bob Laferriere
>
> This seems a repeat of SOLR-261 which was fixed in 1.3 but I am seeing the
> same behavior described. When I have a stopword in a boolean query the
> resulting query is invalid.
> e.g. Document --> "No Smoking Sign"
> Stopword: "No"
> Query:"No AND Smoking AND Sign"
> The resultant query is a boolean query with a blank field so an empty boolean
> query. This is expanding as "? Smoking Sign" which then leads to no matches
> as "?" AND "Smoking" AND "sign" has no match.
> The expected behavior is to remove the empty boolean clause from the query.
> In the Analysis tool the parsing showing that "No AND Smoking AND Sign"
> analyzes to "Smoke Sign". I would expect the same behavior by the
> QueryParser, but this is not true. The real parsed query is trying to do the
> following: <empty boolean query> Smoke Sign.
> The only workaround is to never allow stopwords in the query or turn off
> stopwords entirely.
--
This message was sent by Atlassian JIRA
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]