Query parsing is not strict boolean logic, this trips up many people even though AND, NOT and OR are used. See: https://lucidworks.com/blog/why-not-and-or-and-not/ I think what you've really got at the top level is a single MUST clause, namely all_class_ids:(371).
What is _not_ happening here is a set intersection as it would if the logic were strictly boolean, and I suspect that expectation is what's misleading you. If that's not the case, post the results of adding &debug=query to your URL, that'll help. Best, Erick On Mon, Feb 16, 2015 at 1:32 PM, Arun Rangarajan <arunrangara...@gmail.com> wrote: > Solr version 4.2.1 > > In my schema, I have "text" type defined as follows: > --- > <fieldType name="text" class="solr.TextField" > positionIncrementGap="100"> > > <analyzer type="index"> > <tokenizer class="solr.WhitespaceTokenizerFactory"/> > <filter class="solr.StopFilterFactory" words="stopwords.txt" > ignoreCase="true"/> > <filter class="solr.WordDelimiterFilterFactory" > preserveOriginal="1" generateWordParts="1" generateNumberParts="1" > catenateWords="1" catenateNumbers="0" catenateAll="1" > splitOnCaseChange="1"/> > <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" > ignoreCase="true" expand="true"/> > <filter class="solr.LowerCaseFilterFactory"/> > <filter class="solr.RemoveDuplicatesTokenFilterFactory"/> > <filter class="solr.ASCIIFoldingFilterFactory"/> > </analyzer> > > <analyzer type="query"> > <tokenizer class="solr.WhitespaceTokenizerFactory"/> > <filter class="solr.StopFilterFactory" words="stopwords.txt" > ignoreCase="true"/> > <filter class="solr.WordDelimiterFilterFactory" > preserveOriginal="1" generateWordParts="1" generateNumberParts="1" > catenateWords="0" catenateNumbers="0" catenateAll="0" > splitOnCaseChange="0"/> > <filter class="solr.LowerCaseFilterFactory"/> > <filter class="solr.RemoveDuplicatesTokenFilterFactory"/> > <filter class="solr.ASCIIFoldingFilterFactory"/> > </analyzer> > > </fieldType> > --- > > Field "name" is of type "text". > > I have another multi-valued int field called "all_class_ids". > > Both fields are indexed. I have 'of' in stopwords.txt file. > > I am using lucene query parser. > > This query > q=name:of&rows=0 > gives no results as expected. > > However, this query: > q=name:of AND all_class_ids:(371)&rows=0 > gives results and is equal to the same number of results as > q=all_class_ids:(371)&rows=0 > > This is happening only for stopwords. Why? > > Thanks.