5

In our example, we have a Careers search feature in which we only want to match on title, job id, or a meta field such as description.

Sample Search

One wonderful feature about SXA is that you have an easy-to-use search functionality which aggregates "all" fields on the item into a computed sxacontent field. When I search for a job I would like to boost the title field over the content field due to the fact that the content tends to be more generic and possibly contain repeated words.

Imagine you are searching for a nursing position but all of the clinical jobs say "nurse" in the content. Only jobs with "nurse" in the title would be relevant.

How would I best approach this in SXA?

  • Is a new computed field required?
  • Would I need to essentially replace the search components with a new search API?
2

At the moment SXA is not using boosting but this is something we were already thinking of. So in the future, you can expect some helpers to easily configure boosting of certain fields or use customizable suggestions.

What I would suggest here is:

  • reconfigure Solr and use Spell Checking feature - there is a chance that this can solve your problem without any SXA modification but at the moment I'm not 100% sure
  • implement your own computed field reader which will use some fancy logic to read the content from the sxacontent field and will prioritize some fields over the other
  • I would solve this on the Solr side of things. I have not look enough into how SXA does search - eventually through ContentSearch. But - Solr has facilities to do field level dynamic boosting through the edismax query parser/handler - which makes you able to control field level querytime boosting - and these can be defined per search if needed - but we normally would define it per usecase through a dedicated request handler in Solr – Klaus Petersen Apr 17 '18 at 20:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.