Search code examples
marklogicmarklogic-9

Ranking MarkLogic search results


I am trying figure out a way to rank search results according to a field that is not part of the search criteria. i.e. relevance of the search not only depend on the matches but documents also have a default relevance rank among themselves.

My searches so far has failed and could not confirm if it is even a supported feature; most cts:search documentation is about ranking matches.

So, is there a built-in marklogic feature that allow us to assign a value multiplier to documents; based on element values for example.

thanks a lot, K.

PS: I use marklogic 9.


Solution

  • Look at cts:boost-query: it takes a primary query that has to match and a secondary query that just affects the score.