I am using sxa search result for rendering the service items which contain coordinates(lat-lang). We have got a new requirement where the same services may be available in different locations. Hence we have a multi-list field that will contain the available locations.

Upon indexing in SOLR, I am indexing the coordinates of all available locations into coordinates_rpt as a multivalued field.

We have customized the SOLR to find the nearby available location for any center point and return the same, hence we should be able to get the distance sent by SOLR and display it in search results along with another item field. As we are using many SXA OOTB search components for this search functionality we want to retain the existing search result behavior and just tweek the result alone. Any help please?

  • Would it be possible to use the pipeline processSearchItems to alter the output? doc.sitecore.com/developers/sxa/19/… Jun 13, 2021 at 14:34
  • @MichaelWest in processsearchitem pipeline provides properties Items and SearchItem and they are not direct solr values, hence not sure if its possible to add the solr returned distance here to the result before rendering in the search result. Jun 17, 2021 at 5:11

1 Answer 1


My first thought would be -as Michael mentioned- the processSearchItems pipeline as that enables you to add data to an object in the SearchItem result list. Problem with this pipeline though (maybe an idea for the SXA team to change this in the future as this question does pop up often) is that you don't have access to the solr results (as far as I know).

So I do think you will need to create you own version of the Sitecore.XA.Feature.Search.Controllers.SearchController. Check the ootb code for the GetResults function and adjust as needed. I think you'll need:

  • change the object that is returned from the query
  • once the SearchItem objects are created, add the extra information into the available object within the SearchItem
  • use the information from the SearchItem with a Model variant (or o_model in Scriban)
  • sure I will try it and let you know soon. Thank you. Jun 15, 2021 at 16:24

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.