Re: Search results differs with sorting on pagination.

2015-09-11 Thread Upayavira
Are you getting out of order scores? Or does the score change between requests? Can you show us some results that you are getting so we might see what's going on? Upayavira On Fri, Sep 11, 2015, at 05:07 AM, Modassar Ather wrote: > Thanks Erick and Upayavira for the responses. One thing which I

Re: Search results differs with sorting on pagination.

2015-09-10 Thread Modassar Ather
Upayavira! I add the fl=id,score,[shard] and saw the shards changing in the response every time and for different shards the response changes but for the same shard result is same on multiple hits. When I add secondary sort field e.g. score the shard remains same across hits. On Thu, Sep 10, 2015

Re: Search results differs with sorting on pagination.

2015-09-10 Thread Upayavira
Add fl=id,score,[shard] to your query, and show us the results of two differing executions. Perhaps we will be able to see the cause of the difference. Upayavira On Thu, Sep 10, 2015, at 05:35 AM, Modassar Ather wrote: > Thanks Erick. There are no replicas on my cluster and the indexing is one

Re: Search results differs with sorting on pagination.

2015-09-10 Thread Modassar Ather
To add to my previous observation I saw the response having results from multiple shards when the secondary sort field is added and they remain same across hits. Kindly help me understand this behavior. Why the results are changing as I understand that the result should be first clubbed together

Re: Search results differs with sorting on pagination.

2015-09-10 Thread Modassar Ather
If two documents come back from different shards with the same score, the order would not be predictable This is fine. What I am not able to understand is that when I do not give a secondary field for sort I am getting the result from one shard which changes to other shard in other hits. Here

Re: Search results differs with sorting on pagination.

2015-09-10 Thread Upayavira
What scores are you getting? If two documents come back from different shards with the same score, the order would not be predictable - probably down to which shard responds first. Fix it with something like sort=score,timestamp or some other time related field. Upayavira On Thu, Sep 10, 2015,

Re: Search results differs with sorting on pagination.

2015-09-10 Thread Erick Erickson
First, if Upayavira's intuition is correct (and I'm guessing it is), then the behavior you're seeing is probably an accident of coding rather than intentional. I think the algorithm is something like this: Node1 gets the original query Node1 sends sub-queries out to each shard. As the results

Re: Search results differs with sorting on pagination.

2015-09-10 Thread Modassar Ather
Thanks Erick and Upayavira for the responses. One thing which I noticed in context of single sort field that the scores differ in each shard response. No score is identical in the response of one shard and they differ too in the responses from other shards. The score I got using fl=score.

Search results differs with sorting on pagination.

2015-09-09 Thread Modassar Ather
Hi, Search results are changed every time the following query is hit. Please note that it is 7 shard cluster of Solr-5.2.1. Query: q=network=50=50=f_sort asc=true=id Following are the fields and their types in my schema.xml. As per my understanding it seems to be the issue of tie among

Re: Search results differs with sorting on pagination.

2015-09-09 Thread Erick Erickson
When the primary sort criteria is identical for two documents, then the _internal_ Lucene document ID is used to break the tie. The internal ID for two docs can be not only different, but in different _order_ on two separate shards. I'm assuming here that each of your shards has multiple replicas

Re: Search results differs with sorting on pagination.

2015-09-09 Thread Modassar Ather
Thanks Erick. There are no replicas on my cluster and the indexing is one time. No updates or additions are done to the index and the segments are optimized at the end of indexing. So adding a secondary sort criteria is the only solution for such issue in sort? Regards, Modassar On Wed, Sep 9,

Re: Search results differs with sorting on pagination.

2015-09-09 Thread Erick Erickson
Hmmm, not quite sure what's going on here, but then I'm not deeply into the code for ordering sub-requests. But adding a secondary sort is probably the easiest and will stand you in good stead going forward. Erick On Wed, Sep 9, 2015 at 9:35 PM, Modassar Ather wrote: >