Does "other" appear in the id, cat, or sku fields? This clause requires it
to appear in at least one of those fields:
+DisjunctionMaxQuery((id:other^10.0 | cat:other^1.4 | sku:other^1.5))
The "and" is treated as the "AND" operator. What query parser are you using?
Without "and", the terms are OR'ed, which is the default query operator.
-- Jack Krupansky
-----Original Message-----
From: Shamik Bandopadhyay
Sent: Tuesday, February 18, 2014 8:53 PM
To: solr-user@lucene.apache.org
Subject: Weird behavior of stopwords in search query
Hi,
I'm observing a weird behavior while using stopwords as part of the
search query. I'm able to replicate it in standalone Solr instance well.
The issue pops up when I'm trying to use "other" and "and" stopword
together in a query string. The query doesn't return any result. But it
works with any other combination. For e.g.
1. query yields no result -->
http://localhost:8983/solr/collection1/browse?q=AWS+other+and+Search&debugQuery=true&wt=xml
Debug Query :
--------------------
<str name="rawquerystring">AWS other and Search</str>
<str name="querystring">AWS other and Search</str><str
name="parsedquery">(+(DisjunctionMaxQuery((id:AWS^10.0 | author:aws^2.0 |
title:aws^10.0 | text:aws^0.5 | cat:AWS^1.4 | keywords:aws^5.0 |
manu:aws^1.1 | description:aws^5.0 | resourcename:aws | name:aws^1.2 |
features:aws | sku:aw^1.5)) +DisjunctionMaxQuery((id:other^10.0 |
cat:other^1.4 | sku:other^1.5)) +DisjunctionMaxQuery((id:Search^10.0 |
author:search^2.0 | title:search^10.0 | text:search^0.5 | cat:Search^1.4 |
keywords:search^5.0 | manu:search^1.1 | description:search^5.0 |
resourcename:search | name:search^1.2 | features:search |
sku:search^1.5))))/no_coord</str>
<str name="parsedquery_toString">+((id:AWS^10.0 | author:aws^2.0 |
title:aws^10.0 | text:aws^0.5 | cat:AWS^1.4 | keywords:aws^5.0 |
manu:aws^1.1 | description:aws^5.0 | resourcename:aws | name:aws^1.2 |
features:aws | sku:aw^1.5) +(id:other^10.0 | cat:other^1.4 | sku:other^1.5)
+(id:Search^10.0 | author:search^2.0 | title:search^10.0 | text:search^0.5
| cat:Search^1.4 | keywords:search^5.0 | manu:search^1.1 |
description:search^5.0 | resourcename:search | name:search^1.2 |
features:search | sku:search^1.5))</str>
2. query yields result -->
http://localhost:8983/solr/collection1/browse?q=AWS+other+an+Search&debugQuery=true&wt=xml
Debug Query
---------------------
<str name="rawquerystring">AWS other an Search</str>
<str name="querystring">AWS other an Search</str><str
name="parsedquery">(+(DisjunctionMaxQuery((id:AWS^10.0 | author:aws^2.0 |
title:aws^10.0 | text:aws^0.5 | cat:AWS^1.4 | keywords:aws^5.0 |
manu:aws^1.1 | description:aws^5.0 | resourcename:aws | name:aws^1.2 |
features:aws | sku:aw^1.5)) DisjunctionMaxQuery((id:other^10.0 |
cat:other^1.4 | sku:other^1.5)) DisjunctionMaxQuery((id:an^10.0 |
cat:an^1.4)) DisjunctionMaxQuery((id:Search^10.0 | author:search^2.0 |
title:search^10.0 | text:search^0.5 | cat:Search^1.4 | keywords:search^5.0
| manu:search^1.1 | description:search^5.0 | resourcename:search |
name:search^1.2 | features:search | sku:search^1.5))))/no_coord</str>
<str name="parsedquery_toString">+((id:AWS^10.0 | author:aws^2.0 |
title:aws^10.0 | text:aws^0.5 | cat:AWS^1.4 | keywords:aws^5.0 |
manu:aws^1.1 | description:aws^5.0 | resourcename:aws | name:aws^1.2 |
features:aws | sku:aw^1.5) (id:other^10.0 | cat:other^1.4 | sku:other^1.5)
(id:an^10.0 | cat:an^1.4) (id:Search^10.0 | author:search^2.0 |
title:search^10.0 | text:search^0.5 | cat:Search^1.4 | keywords:search^5.0
| manu:search^1.1 | description:search^5.0 | resourcename:search |
name:search^1.2 | features:search | sku:search^1.5))</str>
Both "other" and "and" are part of the stopwords list.
I ran an analysis on text_general field, both stopwords were shows as
ignored during indexing and query time, but not happening during actual
search.
Not sure what I'm missing here, any pointers will be appreciated.
- Thanks,
Shamik