0

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

4

You may find the following articles helpful for setting up and using Sitecore's Content Search API, which was introduced in version 7.

Some keywords you may also find helpful when researching the topic include SOLR, Sitecore, and Content Search API.

| improve this answer | |
1

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"));
}
| improve this answer | |
  • That means i can use Sitecore's LINQ-based search API.. – Mstech May 20 '17 at 1:12
  • 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
  • That is why I cannot find any SOLR APIs..Got it..Thanks! – Mstech May 21 '17 at 14:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.