Oh, I see what you are trying to do, you were confusing :)
To get the exact position of a particular document in the ranked list, you will
need to loop through the whole list, as that's exactly what Solr has to do to
get to the that document.
However, you could do some optimization with the score using a filter query. For
example if you have the query Q and the document you care about have url_id=URL.
You can do two queries: Q and Q&fq=url_id:URL. The second query tells you if
document URL is in the result set, and if it is, what's it's score (as filter query
doesn't affect relevance score). Using this score and the scores of the documents
in the first query, you can estimate where in the result set is the document. I
guess you can also do some sort of binary search if you really want the exact
ranking too.
Hope this helps,
Tri
On Jun 23, 2014, at 10:03 PM, Jorge Luis Betancourt Gonzalez
<jlbetanco...@uci.cu> wrote:
Yes, but I’m looking for the position of the url field of interest in the
response of solr. Solr matches the terms against the collection of documents
and returns sorted list by score, what I’m trying to do is get the position of
the a specific id in this sorted response. The response could be something like
position: 5, or position 500. To do this manually suppose the response consists
of a very large amount of documents (webpages) in this case I would need to
iterate over the complete response to find the position, which in a worst case
scenario could be in the last page for instance. For this particular use case
I’m not so interested in the URL field per se but more on the position a
certain url has in the full solr response.
On Jun 24, 2014, at 12:31 AM, Walter Underwood <wun...@wunderwood.org >
wrote:
> Solr is designed to do exactly this very, very fast. So there isn't a
faster way to do it. But you only need to fetch the URL field. You can ignore
everything else.
>
> wunder
>
> On Jun 23, 2014, at 9:32 PM, Jorge Luis Betancourt Gonzalez <jlbetanco...@uci.cu > wrote:
>
> > Basically given a few search terms (query) the idea is to know given one or more terms in which position your website is located for those specific terms.
> >
> > On Jun 24, 2014, at 12:12 AM, Aman Tandon <amantandon...@gmail.com > wrote:
> >
> > > What kind of search criteria, could you please explain
> > >
> > > With Regards
> > > Aman Tandon
> > >
> > >
> > > On Tue, Jun 24, 2014 at 4:30 AM, Jorge Luis Betancourt Gonzalez <
> > > jlbetanco...@uci.cu > wrote:
> > >
> > > > I’m using Solr for an analytic use case, one of the requirements is
> > > > basically given a search query get the
position of the first hit. I’m
> > > > indexing web pages, so given a search
criteria the client want’s to know
> > > > the position (first occurrence) of his
webpage in the result set (if it
> > > > appears at all). Is any way of getting this
position without iterating and
> > > > manually checking the solr response?
> > > >
> > > > Greetings,
> > > >
> > > >
> > > > VII Escuela Internacional de Verano en la UCI del 30 de junio al 11 de
> > > > julio de 2014. Ver www.uci.cu
> > > >
> >
> > VII Escuela Internacional de Verano en la UCI del 30 de junio al 11 de julio de 2014. Ver www.uci.cu
>
>
>
>
VII Escuela Internacional de Verano en la UCI del 30 de junio al 11 de julio de
2014. Ver www.uci.cu