0

My SOLR documents are wine entities. When a user search for a keyword "Haut Bailly" (it's a wine from bordeaux), I would like to get first a closely matching document with shorter title length, ex:

  1. "Château Haut-Bailly - Pessac-Léognan"
  2. "Château Haut-Bailly La Parde de Haut Bailly - Pessac-Léognan"

However with default solr queries, the keywords "haut bailly" return this ranking:

  1. "Château Haut-Bailly La Parde de Haut Bailly - Pessac-Léognan"
  2. "Château Haut-Bailly - Pessac-Léognan"

Is there any parameters that I could play with to increase the score of a match that is closer to phrase searched (in terms of length) and shorter field (here it's title)? So that here the right wine ("Château Haut-Bailly - Pessac-Léognan") comes up in ranking?

Thank you!

sehe
  • 374,641
  • 47
  • 450
  • 633
Ironflood
  • 73
  • 1
  • 6

2 Answers2

0

I think default scoring would already do that (if you are not omitting norms with omitNorms). The first document scores higher cause it has the search twice (most possibly it is matching Haut-Bailly as well, or one of the words, depending on the tokenizer/parser you are using)

Persimmonium
  • 15,593
  • 11
  • 47
  • 78
0

Using a duplicate filter might work http://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters#solr.RemoveDuplicatesTokenFilterFactory

d whelan
  • 804
  • 5
  • 8