Global Search display order (Moodle 3.2)

Global Search display order (Moodle 3.2)

by Alyson Stibbard -
Number of replies: 0

Apologies if this is not the best place to post this...

We have recently installed Global Search with Solr in Moodle 3.2 on a Windows 2012 R2 server running IIS 8.5. We're very pleased with the way it's working and would like to understand it better. 

At our last development meeting I was asked to find out where in the code the order of the search results is determined and how this is done. I'm struggling to do this and wonder if anyone could help me. The developer Prateek Sachan says the following in both the forum post https://moodle.org/mod/forum/discuss.php?d=227805 and the development page https://docs.moodle.org/dev/Global_search_(GSoC2013):

The results will be based on "relevance weightage". For example:

Case I:

Lesson A contains 1 occurances of "batman superman" (as a phrase..both words are together)

Lesson B contains 10 occurances of batman and 6 occurances of superman.

If a user searches for "batman superman" Lesson B will have higher priority (or relevance) as comparerd to Lesson A

Case II:

Lesson A contains 10 occurances of "batman superman" (as a phrase..both words are together)

Lesson B contains 10 occurances of batman and 6 occurances of superman.

If a user searches for "batman superman" Lesson A will have higher priority (or relevance) as comparerd to Lesson B

However, I'd like to understand the ordering at a more granular level than that, e.g. how a "relevance weighting" is calculated and how, within a particular relevance weighting, the results are ordered.

I've read that from moodle 3.5 onwards it is possible to upgrade the Global Search plugin to determine your own ordering but we are not in a position to upgrade the site for a while yet.

Many thanks for your help.

Alyson

Average of ratings: -