Field boost on query and custom sorting

(from github.com/vitorcoxta)
Hi! Currently me and my team are using a search engine that runs on SOLR. However, that search engine has several problems, so we’re currently analyzing Fess as a possible replacement.

However, we have a question regarding boosting on fields. On the current system, we have a boosting of the title on factor 5, and boosting of content on factor 1 (so, no boosting on the content). We are trying to apply the same boost on Fess, so the results from both systems would appear the same. However, that doesn’t seem to happen…

The way we tried to apply boosting on the title and the content in Fess was updating the following properties in the fess_config.properties file:

# boost
query.boost.title=5.0
query.boost.title.lang=5.0
query.boost.content=1.0
query.boost.content.lang=1.0

However, the results are displayed in the same order as if we put the factor 5 on content and factor 1 on title, or if we leave these properties with their initial values (0.2, 1.0, 0.1, 0.5).

So, the question is: are we applying the boost in the correct way? Or should this be done any other way? (by the way, what is the difference between the property and property.lang in these boost properties?)

The second question is: is there a way to add custom sorting, or is Fess restricted to the sorting terms described in the docs here? For example, we would like to sort the results by how many times the search terms appear in the title, descendant. On a more complex side, and ideally, we would like to combine that value with the length of the title, so the search results would display first the documents with titles that had both small length and high number times the keywords appeared there. Is something like this possible? If so, how can we do it?

(from github.com/marevol)

are we applying the boost in the correct way?

query.boost.* are query boost parameters.
You can check score for search results in Admin Search page.

(by the way, what is the difference between the property and property.lang in these boost properties?)

Fess detects a language for documents automatically.
If indexed documents have language fields for title/content, they are used at search time.
Each language field contains language-specific analyzer to improve search quality.

is there a way to add custom sorting

Yes, you can add it. In fess_config.properties, add it to:

query.additional.search.fields=

we would like to sort the results by how many times the search terms appear in the title, descendant.

It seems to be Similarity setting.
In Fess, to change it from BM25, set it in apps/WEB-INF/classes/fess_indices/fess.json and then reindex fess index in Upgrade page.

(from github.com/vitorcoxta)
Hi @marevol , thank you for your response. I’m seeing now that the title and content boost indeed change the score.

However, I’m still a bit lost regarding the sorting question. What would I add in query.additional.search.fields= ? And how could I use it? An example would be extremely helpful.

Also, I can’t find anything related to BM25 on the file you mentioned… Can you please specify?

Thank you.

(from github.com/vitorcoxta)
My last questions here are not needed anymore, hence closing the ticket.