lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jack Krupansky" <>
Subject Re: how to include result ordinal in response
Date Fri, 03 Jan 2014 23:58:42 GMT
Or just use the internal document ID: fl=*,[docid]

Granted, the docID may change if a segment merge occurs and earlier 
documents have been deleted, but it may be sufficient for your purposes.

-- Jack Krupansky

-----Original Message----- 
From: Upayavira
Sent: Friday, January 03, 2014 5:58 PM
Subject: Re: how to include result ordinal in response

On Fri, Jan 3, 2014, at 10:00 PM, Peter Keegan wrote:
> Is there a simple way to output the result number (ordinal) with each
> returned document using the 'fl' parameter? This would be useful when
> visually comparing the results from 2 queries.

I'm not aware of a simple way.

If you're competent in Java, this could be a neat new DocTransformer
component. You'd say:


and you'd get a new field in your search results.

Cruder ways would be to use XSLT to add it to an XML output, or a
velocity template, but the DocTransformer approach would create
something that could be of ongoing use.


View raw message