lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erick Erickson <erickerick...@gmail.com>
Subject Re: Inconsistent Solr Search Results
Date Thu, 23 Jul 2015 16:17:34 GMT
The query you're running would help. But here's a guess:
You say you have a "3 node Solr cluster". By that I'm
guessing you mean a single shard with 1 leader
and 2 replicas.

when the primary sort criteria (score by default) is tied
between two documents, the internal Lucene doc ID
is used as a tiebreaker. If you're doing something like a
*:* query (asterisk:asterisk in case bolding happens)
then the score for all docs is the same. Here's the kicker:
the internal Lucene doc id will be different in each replica.
So my guess is you're getting results from different
replicas where the internal doc id is between docs has
different relations.

So I claim you don't get different results every time, you get
1 of three result orderings at a guess.

If you have a decent size corpus and are searching by more
interesting criteria this should be much less of a problem, but
still theoretically can happen. To nail down the ordering
completely, specify a secondary sort, as &sort=score,id

Best,
Erick

On Thu, Jul 23, 2015 at 8:46 AM, Tarala, Magesh <MTarala@bh.com> wrote:
> I have about 15K documents in a 3 node solr cluster. When I execute a simple search,
I get the results in different order every time I search. But the number of records is the
same. Here's the definition for the field.
>
> Any ideas, suggestions would be greatly appreciated.
>
>
>     <fieldType name="text_en" class="solr.TextField" positionIncrementGap="100">
>
>       <analyzer type="index">
>         <charFilter class="solr.HTMLStripCharFilterFactory"/>
>         <tokenizer class="solr.StandardTokenizerFactory"/>
>         <filter class="solr.StopFilterFactory"
>                 ignoreCase="true"
>                 words="lang/stopwords_en.txt"
>                 />
>         <filter class="solr.LowerCaseFilterFactory"/>
>         <filter class="solr.EnglishPossessiveFilterFactory"/>
>         <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
>         <filter class="solr.PorterStemFilterFactory"/>
>        <filter class="solr.NGramFilterFactory" minGramSize="3" maxGramSize="50"/>
>       </analyzer>
>
>       <analyzer type="query">
>         <tokenizer class="solr.StandardTokenizerFactory"/>
>         <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true"
expand="true"/>
>         <filter class="solr.StopFilterFactory"
>                 ignoreCase="true"
>                 words="lang/stopwords_en.txt"
>                 />
>         <filter class="solr.LowerCaseFilterFactory"/>
>         <filter class="solr.EnglishPossessiveFilterFactory"/>
>         <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
>         <filter class="solr.PorterStemFilterFactory"/>
>       </analyzer>
>
>     </fieldType>
>
>
> Thanks,
> Magesh
>

Mime
View raw message