Hoss Man created SOLR-6574:
------------------------------

             Summary: new ValueSources & parser syntax for "coercing" the 
datatypes used in wrapped ValueSources
                 Key: SOLR-6574
                 URL: https://issues.apache.org/jira/browse/SOLR-6574
             Project: Solr
          Issue Type: Improvement
            Reporter: Hoss Man



Something i've been thinking about for a while, but SOLR-6562 recently goaded 
me into opening a jira for...

we could/should add ValueSourceParses for "coercing" the datatypes of the 
ValueSources that they wrap, as a way of contorlling wether we ultimately call 
FunctionValues.floatValue(docid) vs intValue(docid) vs longValue(docid) etc...

so while "sum(field1, field2)" currently does float based math on the two 
fields, we could use "int(sum(field1, field2))" which would create some new 
"CoerceIntValueSource" that would wrap the existing SumValueSource, and every 
type specific method in CoerceIntValueSource's FunctionValues would delegate to 
SumValueSource's intValue method -- and likewise: CoerceIntValueSource's 
objectVal() method would return an Integer wrapped arround the results of the 
intValue(docid).


(FWIW: i think a bunch of the existing "math" based FunctionValues currently 
implement most of their methods like intValue/longValue/doubleValue/etc... by 
just delegating to floatValue -- so for this to work properly that would have 
to be fixed as well, but those fixes can & should be tracked in their own jiras)




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to