You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by deniz <de...@gmail.com> on 2012/12/05 04:54:57 UTC

ids parameter decides the result set and order, no matter what kind of query you enter

hello,

as you might have seen I had a question about ids paramater in the solr
request as seen here:
http://lucene.472066.n3.nabble.com/Solr-Query-Parameter-ids-What-is-this-used-for-td4024152.html

basically, I kept playing with it and it seems like it stores unique field
values from the index... and after digging it some time, i realised that no
matter what query you may enter, you can only see the documents that you
have put their unique field to the ids parameter, and that is also behaving
in the same way on a standalone instance. 

so as an example, 

my url looks like this : 
http://localhost:8994/solr/testcore/select?q=name:deniz&wt=xml&sort=email%20desc&fl=*,score&ids=deniz,stephan

and the result is 


<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">0</int>
<lst name="params">
<str name="sort">email desc</str>
<str name="fl">*,score</str>
<str name="wt">xml</str>
<str name="q">name:deniz</str>
<str name="ids">stephan,deniz</str>
</lst>
</lst>
<result name="response" numFound="2" start="0">
<doc>
<str name="id">13</str>
<str name="fullname">stephan mariusz</str>
<str name="name">stephan</str>
<str name="email">stephan@mail</str>
<long name="_version_">1420387699192233984</long>
</doc>
<doc>
<str name="id">17</str>
<str name="fullname">deniz durmus</str>
<str name="name">deniz</str>
<str name="email">deniz@mail</str>
<long name="_version_">1420387699196428288</long>
</doc>
</result>
</response>

so i can see a document which doesnt have anything in name field related
with "deniz" as well as score field is still invisible although it is in
fl... 

can someone give me more details about this ids field and why there is no
(as far as i found) documentation about it? 


the reason i am digging ids field is this:

i have a field, which behaves like score field and it simply shows a
documents position within the full result of solr query. so on a sharded
environment, first query which is sent to one of the shards only returns
unique fields, which are to be used to query the other shards.. however, the
list of ids is not ordered, looks like picked randomly. but as my custom
field puts its position information to the document when you query it, it
has a random order too... and when the other shard responding to the query
with ids parameter, it returns the documents in exactly the same order with
ids list. and after getting the documents, sorting is done, while solr sees
my custom field as any other normal field and position information becomes
incorrect for the end user. 

with in order to make it clear where to change my code, i need to know more
about ids field which is not documented... anyone knows any documentation
about this ids parameter? or anyone who can give me detailed information? 





-----
Zeki ama calismiyor... Calissa yapar...
--
View this message in context: http://lucene.472066.n3.nabble.com/ids-parameter-decides-the-result-set-and-order-no-matter-what-kind-of-query-you-enter-tp4024390.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: ids parameter decides the result set and order, no matter what kind of query you enter

Posted by deniz <de...@gmail.com>.
replying my own question. ids is used in responsebuilders some internal
mapping structure which is used for sorting and reordering document list
before it is shown to the end user... simply it stores unique field values
from documents which are to be shown to the user, and each mapping of these
ids are actual documents which were gathered from other shards, including
their positions on shards and their future position in merged resultset





-----
Zeki ama calismiyor... Calissa yapar...
--
View this message in context: http://lucene.472066.n3.nabble.com/ids-parameter-decides-the-result-set-and-order-no-matter-what-kind-of-query-you-enter-tp4024390p4024412.html
Sent from the Solr - User mailing list archive at Nabble.com.