Hi Victor You want to look at setting a similarity other than TF IDF. For example here's BM25 Similarity
https://lucene.apache.org/core/4_0_0/core/org/apache/lucene/search/similarities/BM25Similarity.html And the "setSimilarity" method on IndexSearcher https://lucene.apache.org/core/5_0_0/core/org/apache/lucene/search/IndexSearcher.html#setSimilarity(org.apache.lucene.search.similarities.Similarity) You can take things further with custom queries/scorers as I blog here http://opensourceconnections.com/blog/2014/01/20/build-your-own-custom-lucene-query-and-scorer/ Cheers Doug On Saturday, November 21, 2015, Victor Makarenkov <viti...@gmail.com> wrote: > Hi everybody! > > I would appreciate if you can refer me to some *example *or explanation of > how to change the scoring function of lucene. > > I would expect 2 options: > > 1. changing some configuration, so the ranking function becomes , say Okapi > BM 25 instead of standard similarity > > 2. Is there any provider in lucene where I can provide my own score class > which implements this? > > an example for that will be highly appreciated, > > Thanks ahead, > Victor > -- *Doug Turnbull **| *Search Relevance Consultant | OpenSource Connections <http://opensourceconnections.com>, LLC | 240.476.9983 Author: Relevant Search <http://manning.com/turnbull> This e-mail and all contents, including attachments, is considered to be Company Confidential unless explicitly stated otherwise, regardless of whether attachments are marked as such.