Is it possible to dynamically retrieve all fields present in a set of Solr documents and still maintain reasonable performance? The end goal here is to dynamically populate a list of numeric fields for users to sort their current query upon.
In a perfect world, I'd like to be able to have this list contain all of the numeric fields present in the docs returned by the user's query.
If this isn't possible to achieve, though, I'm going to populate the list with numeric fields via the luke handler. Unfortunately it seems that the luke handler returns fields for the entire collection, but can't be restricted to only the current query.
I'm fairly new to Solr, so any help/discussion would be greatly appreciated!
This is how I solved my problem:
SORT_DOC_FIELDS
and NO_SORT_DOC_FIELDS
.tdate
or string
). If it could be sorted upon, I added it to the SORT_DOC_FIELDS
field for that document; if not, I added it to the NO_SORT_DOC_FIELDS
field.&facet=true&facet.field=SORT_DOC_FIELDS&facet.field=NO_SORT_DOC_FIELDS&facet.limit=-1
to the query string.The performance is OK. I have an index of 30 million documents, and making the query and getting a response, round-trip, takes about 2s.