I have a requirement to implement a custom search box and pull search results based on scope and then present the search results by combining components created using two templates.
I am trying to use the Search method in ISearchService -
IEnumerable<Item> results = new List<Item>(); results = searchService.Search("", scopeItem.ID.ToString(), Sitecore.Context.Language.ToString());
The Search method is expecting a string query as first argument, which if I pass as my search term is not giving me any results. But if I query for an empty string, I am getting all items from the Scope in the result set. I am doing string operations to see if any of the fields contains my search term.
Looking for a better way to implement this something like -
results = searchService.Search(searchTerm, scopeItem.ID.ToString(), Sitecore.Context.Language.ToString());