Relevance Tuning

Optimize Search Ranking with Relevancy Tuning and Customizable Templates in SearchBlox

Relevancy Tuning in Search

Relevancy Tuning in SearchBlox allows you to customize how search results are ranked and displayed based on content type, metadata, or other criteria. This feature ensures that the most relevant results are prioritized, improving the overall search experience.

Key Features

  • Pre-Made Templates:
    Use built-in tuning templates to quickly adjust relevance for common content types.
  • Custom Templates:
    Create and save your own tuning presets tailored to your organization’s unique content.
  • Preview Tuned Results:
    Preview search results after applying tuning to ensure they meet your expectations.
  • Field Boosting:
    Adjust the ranking of search results by boosting specific fields (e.g., title, metadata, or custom fields).
  • URL Parameters:
    Relevancy tuning can also be applied dynamically using URL parameters in the search query.

How to Use Relevancy Tuning:

  1. Access Relevancy Tuning Settings:
    Navigate to the Relevancy Tuning section in the SearchBlox Dashboard.
  2. Choose a Template:
    Select a pre-made template or create a custom template based on your needs.
  3. Adjust Field Boosting:
    Boost specific fields (e.g., title, description, metadata) to influence how results are ranked.
  4. Preview Results:
    Use the preview feature to see how the tuned results will appear to users.
  5. Save and Apply:
    Save your tuning settings and apply them to the search interface.

Standard Field Boosting

Standard Fields (title, description, URL, keywords, date recency, URL length and clicklog) can be boosted to tune the relevancy of search results

ParameterDescriptionDefault valueRange of valuesExample
tuneEnables or disables relevance tuningtruetrue or falsehttps://localhost:8443/rest/v2/api/search?public=true&query=time&tune=false
Title(tune.0)Weight used to increase relevance of document if search query appears in document title 251 to 100https://localhost:8443/rest/v2/api/search?public=true&query=time&tune.0=50
Description(tune.1)Weight used to increase relevance of document if search query appears in document description 151 to 100https://localhost:8443/rest/v2/api/search?public=true&query=time&tune.1=50
Keywords(tune.2)Weight used to increase relevance of document if search query appears in keywords meta field251 to 100https://localhost:8443/rest/v2/api/search?public=true&query=time&tune.2=50
Keywords in URL(tune.3)Weight used to increase relevance of document if search query appears in document url 101 to 100https://localhost:8443/rest/v2/api/search?public=true&query=time&tune.3=50
Last modified date(tune.4)Documents within 180 days are ranked higher than older documents. This sets the time period (in days) after which the relevance of documents decreases based on the document last modified date1Number of Days
You can give any value between 1 and 1000
https://localhost:8443/rest/v2/api/search?public=true&query=time&tune.4=30

Number of days = 30
URL length(tune.5)Shorter urls will be ranked higher than longer urls based on length 11 to 100https://localhost:8443/rest/v2/api/search?public=true&query=time&tune.5=50
Click weight(tune.6)More the number of clicks made to the result, more will be the relevancy51 to 100https://localhost:8443/rest/v2/api/search?public=true&query=time&tune.6=50

SearchBlox allows you to perform advanced relevancy tuning by boosting multiple parameters simultaneously using URL parameters in the search query. This feature provides flexibility to fine-tune search results based on specific requirements.

  1. Boosting Description and Recent Documents:

To boost the description field and prioritize documents that are less than 30 days old, use the following URL:

https\://localhost:8443/rest/v2/api/search?public=true&query=time&tune.1=50&tune.4=30

tune.1=50: Boosts the description field by a factor of 50.
tune.4=30: Boosts documents that are less than 30 days old.

  1. Boosting Keywords and URL:

To boost the keywords and URL fields, use the following URL:

https\://localhost:8443/rest/v2/api/search?public=true&query=time&tune.2=50&tune.3=30

tune.2=50: Boosts the keywords field by a factor of 50.
tune.3=30: Boosts the URL field by a factor of 30.

  1. Boosting Viewed Results and Title:

To boost results that have been viewed by users and prioritize the title field, use the following URL:

https\://localhost:8443/rest/v2/api/search?public=true&query=time&tune.6=50&tune.0=30

tune.6=50: Boosts results that have been viewed by users.
tune.0=30: Boosts the title field by a factor of 30.

tune.0 Boosts the title field.
tune.1 Boosts the description field.
tune.2 Boosts the keywords field.
tune.3 Boosts the URL field.
tune.4 Boosts documents based on recency (e.g., less than 30 days old).
tune.6 Boosts results based on user views (popularity).

Custom Field Boosting

Custom field boosting can be used by the user to boost fields such as metadata, file properties and other custom fields that are indexed in SearchBlox.

ParameterDescriptionDefault valueRange of ValuesExample
tune.fieldProvides the ability to facet on any fieldNoAny standard or custom field including term, number or date fields&tune.field=size&t.size.factor=10&t.size.modifier=square
tune.field.weightWeight to be used to increase relevance of document if search query appears in document custom field. This is for text fieldNo1 to 100&tune.field=author&t.author.value=john&t.author.weight=100
tune.field.factorThis factor is applicable for numerical field.
Please make sure to add the custom numerical field in your mapping.json.
No1 to 100&tune.field=size&t.size.factor=10&t.size.modifier=reciprocal
tune.field.modifierThis factor is applicable for numerical fields and has to be provided with tune.field.factorNonone - Do not apply any multiplier to the field value
log - Take the logarithm of the field value
log1p Add 1 to the field value and take the logarithm
log2p - Add 2 to the field value and take the logarithm
ln - Take the natural logarithm of the field value
ln1p - Add 1 to the field value and take the natural logarithm
ln2p - Add 2 to the field value and take the natural logarithm
square - Square the field value (multiply it by itself)
sqrt - Take the square root of the field value
reciprocal - Reciprocate the field value, same as 1/x where x is the field’s value
missing - Value used if the document doesn’t have that field. The modifier and factor are still applied to it as though it were read from the document.
To increase relevance larger documents

tune.field=size&t.size.factor=10&t.size.modifier=square

square - If square is provided as modifier greater the field value greater the relevance

To reduce the relevance of larger documents

&tune.field=size&t.size.factor=10&t.size.modifier=reciprocal

reciprocal - If reciprocal is provided as modifier lower the field value greater the relevance

For a numerical field the mapping should be as shown in mapping.json or any other relevant file in SearchBlox.
"numfield": {
"type": "double",
"store": true,
"index": false
},

Manual Rank (or mRank)

This feature can be used to manually rank specific documents on top of the search results page, irrespective of the relevancy mechanism supported by SearchBlox.
Adding rank requires additional sorting tweaks to be done in the preview window of relevance tuning to sort search parameters.

Search Level Boosting

Boosting can be done during Search by using ^ operator.

In the following example, software is given boost over test, so results with software will appear on top.
test software^100

In this example, the title field is given more boost over the keywords _field, so the results with the title _world will appear on top.
example, keywords:news title:world^500

Specific content types can be boosted by using the search query with the content type field.

example, library AND (contenttype:html OR *)

example, (library OR title:library) AND (contenttype:html OR *)

The search boosting query value can be passed through the filter param to avoid the user search term from being changed.

https://localhost:8443/rest/v2/api/search?query=library&filter=libraryAND(contenttype:htmlOR*)

https://localhost:8443/rest/v2/api/search?query=library&filter=(libraryORtitle:library)AND(contenttype:htmlOR*)

After making changes, please restart the build, reindex and then perform the search.

Disabling Relevancy tuning

Relevancy tuning can disabled provided based on the preceding section by providing &tune=false in the search servlet URL
Example:

https://localhost:8443/rest/v2/api/search?public=true&query=apple&tune=false