Reputation: 1066
I have an index that is set to index my site components and pages. I need to use field boosting for fields like Title, Description or Name. I've set in templates a boosting value 150, 100, and 50. If I search something that is only in Title, it does not boost the page in search ranking.
If I set the boosting on the component where the search word is found it gets boosted to the first position. After I delete the boosting form the component the search results does not change.
For search I'm using GetQueryable from IProviderSearchContext. How should I should set those templates so when I index the components I will get the pages as expected per boosting?
Upvotes: 1
Views: 1104
Reputation: 2635
If I understand correctly you are trying to boost fields, but that should not be done in the templates but in your configuration.
You can read all about it in this John West blog.
For field boosting:
You can boost the importance of specific fields. For example, you may want to boost the value of specific fields, such as title or abstract. Field boosting applies at indexing time, making it efficient but static. Set the boost attribute of the relevant /configuration/sitecore/contentSearch/configuration/DefaultIndexConfiguration/fieldMap/fieldNames/fieldName element in the Web.config file, typically specified in the /App_Config/Include/Sitecore.ContentSearch.Lucene.DefaultIndexConfiguration.config Web.config include file. All indexes share this configuration by default.
He mentions the default index config here, but you can set it for your custom index just the same.
Upvotes: 0