search component | Community
Skip to main content
Jai1122
Level 4
October 16, 2015
Solved

search component

  • October 16, 2015
  • 3 replies
  • 1572 views

My requirement is to create a blog which also includes creating a search component that is used to search by author, date and category. The OOTB component (/libs/social/blog/components/search) is not helping for date search. I checked the code for it the form action points to the same page. I could not understand how the code works. On clicking search the url changes to

    localhost:4502/cf#/content/Jai/blog.html?query={search-string}&blog=search&_charset_=UTF-8

Kindly let me know which script/bundle/code gets executed when the url gets appended with search parameters

I am using Adobe CQ5.6.1. Thanks in advance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

See the search component discussion in this topic:

http://docs.adobe.com/docs/en/aem/6-0/develop/the-basics/website.html

There is a detailed discussion about creating a Search component. Once you understand that  - you can extend it to meet your requirements. 

3 replies

Jai1122
Jai1122Author
Level 4
October 16, 2015

Thanks for the response. I some how figuredout how the OOTB search component works. 

The xpathquery formed is  /jcr:root/content/farmers-blog/*[not(fn:name() = 'unlisted')]/*/element(*, cq:Page)[jcr:contains(., '{searchquery1}') or jcr:contains(., '{searchquery2}')]

 

But this does not work for date. I could not make a search using date. Should there be any changes made in xpathquery formed??

WhoaShekhar
Level 10
October 16, 2015
smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

See the search component discussion in this topic:

http://docs.adobe.com/docs/en/aem/6-0/develop/the-basics/website.html

There is a detailed discussion about creating a Search component. Once you understand that  - you can extend it to meet your requirements.