Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

invoking search service directly from browser in aem 6.2

Avatar

Level 4

Hi

Am looking at use case to invoke search directly by making service call or by providing short url. I tried to invoke search service by hitting directly in browser and it takes to login screen; after login, it will display a json, but am looking at landing at search page. Is there any sling setting to be enabled?

http://localhost:4502/mnt/overlay/granite/ui/content/shell/omnisearch/searchresults.html?_charset_=u... HTTP/1.1

/libs/granite/ui/content/shell/omnisearch/searchresults/singleresults/searchpanel.html?location=site

3 Replies

Avatar

Level 10

I would look at writing a Sling Servlet and then return the result set as the servlet output. 

Avatar

Level 4

am looking at making user land to search screen on click on of a URL.

Avatar

Administrator

mohanb wrote...

am looking at making user land to search screen on click on of a URL.

 

Hi, 

The solution provided by scott will do the same.

Look at this example:-

Link:- https://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html

// Here Post request to the "/bin/mySearchServlet" is returning the data. You could also write a service using query builder API and can create a url to return data.

Link:- https://helpx.adobe.com/experience-manager/using/using-query-builder-api1.html

//Use of Query builder api.

~kautuk



Kautuk Sahni