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 Russell Black <rb...@fold3.com> on 2012/01/21 02:32:48 UTC
frange with multi-valued fields
Has anyone had experience using frange with multi-valued fields? In solr 3.5 doing so results in the error: "can not use FieldCache on multivalued field"
Here's the use case. We have multiple years attached to each document and want to be able to refine by a year range. We're currently using the standard range query syntax [ 1900 TO 1910 ] which works, but those queries are slower than we would like. I've seen reports that using frange can greatly improve performance. http://solr.pl/en/2011/05/30/quick-look-frange/
>From what I can tell, there seem to be efforts in 4.0 to allow functions to work on multivalued fields. Does anyone know for sure?
Thanks,
Russ
Re: frange with multi-valued fields
Posted by Chris Hostetter <ho...@fucit.org>.
: Has anyone had experience using frange with multi-valued fields? In
: solr 3.5 doing so results in the error: "can not use FieldCache on
: multivalued field"
correct.
: Here's the use case. We have multiple years attached to each document
: and want to be able to refine by a year range. We're currently using
: the standard range query syntax [ 1900 TO 1910 ] which works, but those
: queries are slower than we would like. I've seen reports that using
: frange can greatly improve performance.
: http://solr.pl/en/2011/05/30/quick-look-frange/
note that there is a mistake in the "Faster implementation"
column of performance table on that article .. the actaul data (and hte
paragraph after the table) indicate that...
"standard range query is faster only for queries that cover a
small number of terms from the given field."
Yonik got similar results when he did testing on range queries over
strings, but the specifics on where the cut-off point was were slightly
different...
https://yonik.wordpress.com/2009/07/06/ranges-over-functions-in-solr-1-4/
In general you'd have to test it, but for things like "years"
unless you are dealing really big spans of time (ie:
[1901 TO 200000]) and will have ranges that are generally large relative
the total span of data you are dealing with, i seriously doubt fgrange
would be much faster for you if you had a single valued fields -- and the
bottom line is frange won't work with multivalued fields.
forget about frange for a moment, and tell us more about your specific
sitaution. to start with: what field configuration are you using right now
for your "year" field? specificly are you using TrieIntField? have you
tried tunning the options on it? how many unique year values are in your
corpus? how big to your ranges usually get?
https://people.apache.org/~hossman/#xyproblem
Your question appears to be an "XY Problem" ... that is: you are dealing
with "X", you are assuming "Y" will help you, and you are asking about "Y"
without giving more details about the "X" so that we can understand the
full issue. Perhaps the best solution doesn't involve "Y" at all?
See Also: http://www.perlmonks.org/index.pl?node_id=542341
-Hoss