sitecore7 - Sitecore Search Multiple words -


how can search multiple words sitecore 7 ? tried contains every word doesn't work fine , think performance it's not good.

you can user predicatebuilder issue :

code like:

 queryable<searchitem> searchtext(list<string> keywords, iqueryable<searchitem> itemlist)     {         var predicate = predicatebuilder.true<searchitem>();          foreach (string keyword in keywords)         {             predicate = predicate.and(i => i.fieldone.contains(keyword) || i.fieldtwo.contains(keyword) || i.fieldthree.contains(keyword) || i.fieldyyy.contains(keyword));         }         return itemlist.where(predicate);     } 

about predicatebuilder can find here : dynamic query using predicate builder


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -