Search Fields Boosting
Field Level Boosting
SearchBlox allows you to configure field-level boosting for individual collections or globally across all collections. Boosting improves the relevance of search results and enhances the overall search experience.
Field Level Boosting for a Single Collection
Find the Collection ID and go to <SearchBlox_Installation_Directory>/webapps/ROOT/WEB-INF/mappings/collections/.
Edit the file mapping_.json, add the boosting property "boost":200 to the required SearchBlox field, and save the file. For example, the snippet below shows how to add boosting to the description field:
"description" : {
"type" : "text",
"boost" : 500.0,
"store" : true,
"term_vector" : "with_positions_offsets",
"analyzer" : "sb_analyzer"
},
- After adding the boost value (to fields such as title, description, URL, content, etc.), you must clear and reindex the collection for the changes to take effect.
- Note: It is recommended to test field-level boosting on a sample collection first. After confirming the desired results, apply the same settings to the main collection.
Field Level Boosting for All Collections
- You can apply these changes in the mapping template file located at <SearchBlox_Installation_Directory>/webapps/ROOT/WEB-INF/mappings/mapping.json. This will apply the same field-level boost values to all collections.
- Modifying the template file affects all collections and is generally not recommended unless you are certain about the changes. Contact SearchBlox Support before making changes to the template.
Cluster Setup
All cluster nodes must be configured with the same field-level boost settings to ensure consistent search results across the cluster.
