Expand my Community achievements bar.

SOLVED

Search Result component

Avatar

Level 3

Hi All,

I am new to implementing site search feature in our AEM site and planned below components for Search functionality(not going for any external search)

1.)Global Search component - where user can provide search input and on submit show the search result component.

2.)Search Result component - Shows the search results with pagination.

Could you please suggest me the best way to implement search result component in AEM 6.3, Touch UI & Sightly.

Also please let me know whether we need to develop any API and Oak index for this requirement, if yes, Please let me know the procedure.

Thanks and Regards

Ram

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

You would need following:

 

Global Search component: This you can add in the Header XF. Add a clientlib, that identifies the search event, then redirect the User to a Search Page. You can add this text search in the query params while redirecting

 

Search page with Result component:

The result component can read the params in the Request URL and return results to be displayed.

When a use navigates through the next page in Search result component, a clientlib identifies it, send params from URL and pageOffset to get results for the required page.

It then replaces the content in the Search results component.

 

Indexes:

Depending on the query trigger by Search Result component, the index can be fine-tuned.  

 

 

 


Aanchal Sikka

View solution in original post

7 Replies

Avatar

Level 8

Hi,

Few things  that I can think of at the top of my head now.

- Is that a full text search or property based search?

- Will you be using any external search servers like SOLR, Search & promote etc.?

- If search is within AEM, you can use Querybuilder predicates to fill in the criteria, put the limit,offset etc.

Creating indexes will fasten up the process, say you are searching for 60k products under a specified path, you can create index rules on certain set of properties.

May be if you can provide some additional details on the above, community will be able in a better position to answer your query.

Avatar

Level 10

See this AEM topic:

How to Create a Fully Featured Internet Website

There is a discussion at end on how to create a Search Component.

Avatar

Level 10

1. Use AEM Query builder API, it supports the concepts with which pagination typically works [0]

2. Pagination can be formed with simple logic in any language but you would need to use offset parameter in query builder

3 Consider creating index if data is huge.

[0] https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/querybuilder-api.html

[1] http://www.adobeaemclub.com/sightly-pagination-component-using-sling-model-and-javascript-use-api-in...

[3] https://helpx.adobe.com/experience-manager/6-3/sites/deploying/using/best-practices-for-queries-and-...

Avatar

Level 3

Hi All,

Thanks for the response.

It's  a fulltext search and includes tags also,restricting the search to the Country & language.

Not using any external search.

Search with in AEM.

Onsubmit of Search component, need to call service in java script & get the search result. Same result send to search result component.

Thanks, Ram.

Avatar

Level 8

I am not sure how effective[performance aspects etc] AEM search, would be w.r.t full-text search.

We can await response from SME's for further inputs. So Basically, you would have to write your custom logic in servlets/service classes and put in the desired logic in there.

Avatar

Level 3

Hi All,

Can anyone explain how Lucene indexing works with MSM based website?

Ex: If same image exists in US & UK site, how Lucene indexing work here?

Will Lucene create separate index for US & UK site?

or

Same index being used for US & UK site?

As per our requirement, we need to show the search results based on country & language specific and shouldn't show other country search results.

Could you please guide me to develop Lucene indexing for MSM based site?

Thanks and Regards,

P Raja Ramesh

Avatar

Correct answer by
Community Advisor

You would need following:

 

Global Search component: This you can add in the Header XF. Add a clientlib, that identifies the search event, then redirect the User to a Search Page. You can add this text search in the query params while redirecting

 

Search page with Result component:

The result component can read the params in the Request URL and return results to be displayed.

When a use navigates through the next page in Search result component, a clientlib identifies it, send params from URL and pageOffset to get results for the required page.

It then replaces the content in the Search results component.

 

Indexes:

Depending on the query trigger by Search Result component, the index can be fine-tuned.  

 

 

 


Aanchal Sikka