lucene - cant understand solr behavior (it returns different results if i change places of words in query)
<p>i need to select all records which have words "6" and "buldings". i'm creating such query to my solr:</p>

<pre><code>/select?q=name:2+AND+buildings
</code></pre>

<p>solr returns me 128 results. most of results have something like "126 buildings" or "buildings 7260" but i need only records with words "6" and "buildings".</p>

<p>but if i change words places in the query: </p>

<pre><code>/select?q=name:buildings+AND+2
</code></pre>

<p>it returns me absolutely another result - the right one! this time there are no strange records with words "7260" or "126" only records that i really need with words "6" and "buildings".</p>

<p>so please can sombody explain to me why solr returns such a strange result in the first case because i create queries without considering that solr can return different results if words places are changed. and <strong>how can i point solr to search only "6" if it goes before word</strong>? </p>

<p>any help appriciated.</p>