Effects of case sensitivity of search term on search score
22 September 2015 01:12 PM
|
|
Introduction This article talks about effects of case sensitivity of search term on search score and thus on final order of search results for a secondary query which is using cts:boost-query and weight. The case-insensitive word term is treated as the lower case word term, so there can be no difference in the frequencies and scores of results for any-case/case-insensitive search term and lowercase search term with “case-sensitive” option or when neither "case-sensitive" nor "case-insensitive" is present. If neither "case-sensitive" nor "case-insensitive" is present, text of search term is used to determine case sensitivity. Understanding relevance score In MarkLogic Search results are returned in a relevance order. The most relevant results are first in result sequence and least relevant are last. Of many ways to control this relevance score one way is to use a secondary query to boost relevance score, https://docs.marklogic.com/guide/search-dev/relevance#id_30927 . This article takes advantage of examples using secondary query to boost relevance scores and impact of text case (upper, lower or unspecifed) of search terms on relevance score on order of results returned. A few examples to understand this scenario Consider a few scenarios where below mentioned queries are trying to boost certain search results up using cts:boost-query and weight for word "washington" in returned results. Example 1: Search with lowercase search term and option for case not specified Query1:
Example 2: Search with lowercase search term and case-sensitive option Query2:
Example 3: Search with uppercase search term and option case-insensitive, in cts:boost-query like below with rest of query similar to above queries Query3: cts:boost-query(cts:element-word-query(xs:QName("test"),"George" ), Results for Query3:
Now let us now take look at a query with a word with uppercase and case-sensitive option in query. Example 4: Search with uppercase search term and option case-sensitive, in cts:boost-query like below with rest of query similar to above queries Query4: cts:boost-query(cts:element-word-query(xs:QName("test"),"George" ), Results for Query4:
As we can clearly see the scores are changed for results for Query4 and thus final order of results is also updated.
While using a secondary query having cts:boost-query and weight, to boost certain search results up, it is important to understand the impact of case of search text on result sequence. A case-insensitive word term is treated as the lower case word term, so there can therefore be no difference in the frequencies of any-case/case-insensitive and lowercase/case-sensitive search terms, and therefore no difference in scoring. For search term with upper case alphabets in text and with “case-sensitive” option scores are boosted up as expected in comparison with a “case-insensitive search”. If neither "case-sensitive" nor "case-insensitive" is present, text of search term is used to determine case sensitivity. If text of search term contains no uppercase, it specifies "case-insensitive". If text of search term contains uppercase, it specifies "case-sensitive".
| |
|