Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Access Sitecore Lucene Search through the Item Web API?

Is it possible to use Lucene Search in Sitecore and have the results returned as JSON by the Sitecore Item Web API?

The documentation for the Sitecore Item Web API on the Sitecore Developer Network doesn't give any examples how to use Lucene Search through the Item Web API.

The end result I'm looking for is to have the search results returned as JSON based on the search parameter provided. Since the Sitecore Item Web API can be used with Sitecore Query to retrieve items it would be convenient to be able to use it for search as well.

like image 679
benadamski Avatar asked Aug 05 '13 05:08

benadamski


1 Answers

I do not think this is possible with the default implementation of the Item Web Api.

You can however extend it. When you look into the config, there is a lot of points where you can hook up with extensions.

You should be able to add your custom processor in the itemWebApiRequest pipeline. I would add new processor there which inherits from Sitecore.ItemWebApi.Pipelines.Request.RequestProcessor and add logic to handle Lucene queries there.

like image 157
Szymon Kuzniak Avatar answered Sep 18 '22 23:09

Szymon Kuzniak