0

I would like to do something like solr relevancy and sort by the scoring. But the SOLR relevancy have some defined score (tf-idf).

For example: I have boost method by field "NAME" and records returned(with score from solr and my expected score).

AA boost score 3

BB boost score 2

AB boost score 1

ID, Name, Score, Expected_Score

1, AA, 8, 3

2, AA, 6, 3

3, AA, 6, 3

4, AABB, 7, 6

5, BB, 9, 2

You can see the solr relevancy will given different score for NAME "AA" as it base on default score from query instead of only field Name. Also the most important is "BB" are given higher score compare to "AA" but the booster score is less.

I would like the scoring just base on customized field and data to boost only, without affected by others field. Similar with MySQL Weightage (ordering results based on combine weightage of fields) but in SOLR

Community
  • 1
  • 1
  • Can you sort by termfreq or something similar in a function query? If you don't want termfreqs to count at all, you can use omitTermFreqAndPositions on your field as well, then use either `boost=` (for multiplicative boosting) or `bq` or `bf` for additive boosting. – MatsLindh Jul 12 '16 at 17:21
  • try it before, but it doesn't work and the idf for less frequency one will be higher score. – vincentleekp Jul 13 '16 at 15:32
  • How about `add` and `if` to check if `termfreq` is above 0 and return 1 in that case? Anyhow - a custom similarity class might be what you want, which just returns 1.0f. – MatsLindh Jul 13 '16 at 22:31

0 Answers0