hossman wrote:
>
>
> : Say I have a custom functionquery MinFloatFunction which takes as its
> : arguments an array of valuesources.
> :
> : MinFloatFunction(ValueSource[] sources)
> :
> : In my case all these valuesources are the values of a collection of
> fields.
>
> a ValueSource isn't required to be field specifc (it may already be the
> mathematical combination of other multiple fields) so there is no generic
> way to get the "field name" form a ValueSource ... but you could define
> your MinFloatFunction only accept FieldCacheSource[] as input ... hmmm,
> ecept that FieldCacheSource doesn't expose the field name. so instead you
> write...
>
> public class MyFieldCacheSource extends FieldCacheSource {
> public MyFieldCacheSource(String field) {
> super(field);
> }
> public String getField() {
> return field;
> }
> }
> public class MinFloatFunction ... {
> public MinFloatFunction(MyFieldCacheSource[] values);
> }
>
Thanks for this. I'm goign to look into this a little further.
hossman wrote:
>
>
> : For this I designed a schema in which each 'row' in the index represents
> a
> : product (indepdent of variants) (which takes care of the 1 variant max)
> and
> : every variant is represented as 2 fields in this row:
> :
> : variant_p_* <-- represents price (stored / indexed)
> : variant_source_* <-- represents the other fields dependent on
> the
> : variant (stored / multivalued)
>
> Note: if you have a lot of varients you may wind up with the same problem
> as described here...
>
> http://www.nabble.com/sorting-on-dynamic-fields---good%2C-bad%2C-neither--tf4694098.html
>
> ...because of the underlying FieldCache usage in FieldCacheValueSource
>
>
> -Hoss
>
>
>
Hmmm. thanks for pointing me to that one ( i guess ;-) I totally
underestimated the memory-requirements of the underlying Lucene Field-cache
implementation.
Having the option to sort on about 10.000 variantfields with about 400.000
docs will consume about 16 GB max. Definitly not doable in my situation. A
LRU-implementation of the lucene field-cache would help big time in this
situation to at least not get OOM-errors. Perhaps , you know of any
existing implementations?
Thanks a lot,
Geert-Jan
--
View this message in context:
http://www.nabble.com/where-to-hook-in-to-SOLR-to-read-field-label-from-functionquery-tf4751109.html#a13682698
Sent from the Solr - User mailing list archive at Nabble.com.