lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emir Arnautović <emir.arnauto...@sematext.com>
Subject Re: Function Query with multi-value field
Date Mon, 15 Jul 2019 13:32:59 GMT
Hi Wei,
I see two options:
1. create custom distance function for colors
2. split each color component to a separate numeric fields and try calculate distance function
using standard set of functions. (I think that Solr does not support 3d points).

HTH,
Emir
--
Monitoring - Log Management - Alerting - Anomaly Detection
Solr & Elasticsearch Consulting Support Training - http://sematext.com/



> On 14 Jul 2019, at 00:47, Wei <weiwang19@gmail.com> wrote:
> 
> Any suggestion?
> 
> On Thu, Jul 11, 2019 at 3:03 PM Wei <weiwang19@gmail.com> wrote:
> 
>> Hi,
>> 
>> I have a question regarding function query that operates on multi-value
>> fields.  For the following field:
>> 
>> <field name=rgbcolor type="string" indexed="true" stored="true"
>> multivalued="true"/>
>> 
>> Each value is a hex string representation of RGB value.  for example
>> there are 3 values indexed
>> 
>> #FF00FF    - C1
>> #EE82EE   - C2
>> #DA70D6   - C3
>> 
>> How would I write a function query that operates on all values of the
>> field?  Given color S in query, how to calculate the similarities between
>> S and C1/C2/C3 and find which one is the closest?
>> I checked https://lucene.apache.org/solr/guide/6_6/function-queries.html but
>> didn't see an example.
>> 
>> Thanks,
>> Wei
>> 


Mime
View raw message