Lucene.Net gives one field more than another

I know I've seen this and I just can't find it.

I have 2 fields that I am looking for - Name and Tags. I want results based on a match in the Name field to score a higher score than those based on the Tags field.

How can i do this?

thank

+2


source to share


2 answers


Along with promotion during search, you can also force fields in different ways during indexing. This means that a general search for a term that can appear in any of the fields will still give the best results for those that match your preferred field, without explicitly specifying where you are looking for that term.



+4


source


You can use the acceleration operator :

title_wa: what ^ 4



if the name matches "something" then its score will be increased according to the factor.

+1


source







All Articles