Hi, there,

We used Solr to index a set of documents and provide free-text search
functionality with sorting options on a number of fields. We have a
requirement that along with each search result we want to obtain the ranges
of a few fields for the resulting documents. Here's an example:

Let's say we indexed documents representing books with the following fields:

title, price, publish_date, description

All of these fields are stored in the index (that can be returned); and
"price" and "publish_date" are sortable as well.

Now suppose we post a query for example "title:art history;price asc", we
want to the following results:

1. the documents satisfying the query (which by default are returned by
solr);
2. the range of the price field of the results.
3. the range of the publish_date of the results.

My question is -- can solr return all of the above data within one
response?  If not, all I can think of is to issue one more query that
"title:art history;publish_date asc" (or desc) so that I can use the first
and last result of this query to get the range for publish_date.  (Due to
the original query already asking to sort by price, we are lucky in this
case that we don't have to issue another query to get the range of price.
But then this does not apply in the general case.)

Any idea is appreciated!

-- 
Regards,

-Hui

Reply via email to