Hi,
I am working on an application that searches for entries that may be
queried by multiple parameters.
These parameters may be sent to SOLR in different sets, each parameter with
it's own weight.

Values for the example below might be as follows:
firstName=John&
firstName.weight=0.2&
id=Aw34563456WWA&
id.weight=0.5&
fullName=John Adreew Jr. Doe and Partners&
fullName.weight=0.3


There is one very important requirement.
No marther how many parameters are out there, the total result score cannot
exceed 1 (100%).
In every case I multiply param weight and result of string comparison.
A field may be used in comparison if it's weight is greater than 0 (in fact
greater than 0.0001).

      <str name="q">{!func v=$global_search_function}</str>
      <str name="global_search_function">sum(
                product($firstName.weight, strdist(literal($firstName),
firstName, edit)),
                map($id.weight, 0.0001, 1000, product($id.weight,
strdist(literal($id), id, edit)), 0),
                map($fullName.weight, 0.0001, 1000,
product($fullName.weight, strdist(literal($fullName), fullName, ngram,10)),
0),
                )</str>

The question is about comparing fullName above.
What function should I use for comparison working on the fullName field the
same way as:
   "John Adreew Jr. Doe and Partners"~10^0.3
?

What are the functions that compare strings, other than strdist?
How do I create function similar to the "John Andrew ..." example above?


Best regards,
Dariusz Wojtas

Reply via email to