0

I have an Object containing multiple RecordTypes, for eg. Type = Two Wheeler, Type = Three Wheeler, Type = Four Wheeler. There is a requirement to implement Communities. As part of the Community Global Search, if the User searches for a particular term, Im supposed to query on this object and return the results separated by RecordType.i.e. the Search Results should have three tabs to display Results for each Type.

Can the above Requirement be achieved OOTB or would this be a complete custom implementation?

  1. Is this possible to do this through OOTB Community Builder? Im not sure if its possible to filter out data from Objects?

  2. Is it possible to have the standard 'Global Search for Peer-to-Peer Communities' for Search Box, and a custom Lightning component to display Search Results? How to get the search results to be processed from the Standard Component into the custom Lightning Component?

3
  • Possible duplicate of Napili template standard search event – Jayant Das Aug 2 '18 at 12:49
  • 1
    I fail to see how this is a duplicate of that questions.,Mohith's question/answers is regarding standard search/navigation events only, the OP's questions is for displaying RecordTypes in different tabs using the Global search Result's Component. and if a custom component is needed, then yes, it is related to mohith's post. (tricky since the questions is basically 2-3 questions) – glls Aug 2 '18 at 13:34
  • @glls - The intent was to provide the OP an approach on how the standard event from the search can be captured in custom components (#2 in the question). Once that is established, I would imagine that the OP will get a pointer out with other details as required of filtering based on record types. Global Search in its current form will not filter on record types. – Jayant Das Aug 2 '18 at 13:47
0

The above is not possible with the OOTB Global Search Result Component.

It can be done in a custom component.

Is it possible to have the standard 'Global Search for Peer-to-Peer Communities' for Search Box, and a custom Lightning component to display Search Results? How to get the search results to be processed from the Standard Component into the custom Lightning Component?

Yes, it is possible,

The standard Global Search Box will basically fire an event that redirects to the search page and append the query in the URL:

https://communtiyDomaine.force.com/communityName/s/global-search/%40uri

query string -> '%40uri'

This basically means that you can fetch the query from the URL easily in order to inject the query in your component when it initializes.

0

Thanks,

The above link by Jayant has helped. We can go with a hybrid approach of having the ‘Global Search for Peer to Peer Communities’ Standard Component, and a custom Lightning Component to show Search Results. I was looking for the Standard Search mainly because of the Autocomplete feature that comes with it.

The Search Result Lightning Component should be configured with a design Resource to hold the OOTB Search Term Context Variable “{!searchString}”. You can then configure your custom component to return results the way you want.

Now one more question on this. Is it possible to access the SearchResults context variable somehow?

The hybrid approach would result in two search queries, one on Global Search and one on the Custom Component Search Results. I'm trying to see if its possible to avoid having two queries and directly obtain and process the result in the second component.

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.