We are using Solr for Search in Sitecore.Is there any "Solr API" or i can use existing Sitecore's LINQ-based search API? If yes, then how since I am not find any SolrAPI implementation example? or Should I process with LINQ-based search APIs? Any example would be highly appreciable
You may find the following articles helpful for setting up and using Sitecore's Content Search API, which was introduced in version 7.
- https://soen.ghost.io/setting-up-solr-for-sitecore-8-x/
- https://soen.ghost.io/a-re-introduction-to-the-contentsearch-api-in-sitecore-part-1/
- https://soen.ghost.io/a-re-introduction-to-the-contentsearch-api-in-sitecore-part-2/
Some keywords you may also find helpful when researching the topic include SOLR, Sitecore, and Content Search API.
Mike's post will get a SOLR up and running for you. As for the question about SOLR specific linq statements, there are none. You just continue to use the normal Sitecore Search Context and Sitecore translates it for you under the covers.
Whether you are using Lucene, SOLR or Azure Search, it's the same search context query.
var index = ContentSearchManager.GetIndex("sitecore_master_index")
using (var context = index.CreateSearchContext())
{
var results = context.GetQueryable<SearchResultItem>()
.Where(x => x.Content.Contains("Your search text"));
}
-
-
Yes, there are no SOLR specific LINQ statements. Just use the normal Search Context queries. They work for all providers. – Chris Auer May 20 '17 at 1:29
-