I am trying to compare two fields (say lastnames), the result should be populated on the go with other fields when I query. So can I have an option to create such custom field in solr which compares the fields and give the results when queried ?
0
votes
Do you have an example of the behavior you're trying to implement?
- MatsLindh
I am using lilyindexer to get the NRT data from Hbase tables to SOLR. So let us say I have two fields in SOLR sender_lastname and receiver_lastname for a particular record which have been pulled from Hbase. Now, I want an extra field, say Comparison_result which would populate "equal" or "not equal" by comparing the sender_lastname and receiver_lastname on solr side. So ideally when I query sender_lastname, receiver_lastname and comaprision_result I should get the result. As I mentioned, comaprision_result field should not be in Hbase and should only be on SOLR side which should pop on go !!
- Dinesh G
@MatsLindh any solution/suggestion for the above mentioned behavior would be really helpful
- Dinesh G
1 Answers
0
votes
This seems a use case for Function Values[1] .
Just explore the available function queries[2], select the one which is the best fit for you and use it as the value of a pseudo field.
[2] https://lucene.apache.org/solr/guide/6_6/function-queries.html#FunctionQueries-AvailableFunctions