I think the similarity way (setting k1 to 0) or a constant score query are probably the best ways. Omitting term freqs and position will also remove positions meaning phrase queries won’t work.
This blog article might be useful for your use case. I discuss a similar prob. https://opensourceconnections.com/blog/2014/12/08/title-search-when-relevancy-is-only-skin-deep/ Doug On Thu, Nov 29, 2018 at 7:59 AM Alexandre Rafalovitch <arafa...@gmail.com> wrote: > Perhaps constant score would be useful here: > > http://lucene.apache.org/solr/guide/7_5/the-standard-query-parser.html#constant-score-with > > Also, all the options like omitTermFreqAndPositions are described > here: > http://lucene.apache.org/solr/guide/7_5/field-type-definitions-and-properties.html#field-default-properties > > Regards, > Alex. > On Thu, 29 Nov 2018 at 05:43, Vincenzo D'Amore <v.dam...@gmail.com> wrote: > > > > Hi all, > > > > I have a relevancy problem, I suppose to know a solution for this problem > > but I would like to know if in your experience there is a better one. > > > > For example I have two documents which have the "termA" in their field > > "title", the former has the "termA" repeated more times but the latter > has > > the term only once. When searching for "termA" the former has bigger > score > > due to TF/IDF. > > > > Both the documents are fairly similar so I don't want that term frequency > > in the title boosts the score. > > The only solution I know to flatten the score when there is a difference > in > > term frequency is having configured my own similarity class in the schema > > that returns constantly 1 for term frequency. > > > > I'm curious to know if you know another way, in the beginning I thought > to > > omit term frequency at index time. > > > > Looking around I've found an old issue > > https://issues.apache.org/jira/browse/LUCENE-1561 where omitTF has been > > renamed into omitTermFreqAndPositions. > > > > What I've understood is that omitting term frequency imply also remove > term > > positions, so very likely omitting term frequency is not what I'm looking > > for. > > > > As said, I'm curious to know if you know another way, and as usual > thanks i > > advance for your time e for your patience. > > > > Best regards, > > Vincenzo > > > > > > -- > > Vincenzo D'Amore > -- CTO, OpenSource Connections Author, Relevant Search http://o19s.com/doug