I have been assigned a task that I should change our solr search to sort a list returned by solr by using the term frequency.
Well, I´ve found a way to do so simply by using omitNorms="true".
The problem is, that this won´t work when I am doing a field – search, say by name:
q=name:jones
Following this example I get a list of document whose term frequency is the highest for the “name” field. But What I wanted to achieve is to have a query that is giving my a list of documents whose term frequency is the highest for ALL fields.
Example: If a User named Jones also has the word “Jones” in his biography 10 times I want that document ranked higher.
Is that possible?
You could search for the query word in all fields and use the fielded query as a filter. Assuming that Solr is setup to search all fields by default, your query should be
q=jones&fq=name:jones