I've been trying to perform a search with examine using OR based criteria.. I have found if i search for 2 words or more it is trying to search for an exact match.. how would i make it perform an or based search?
Not 100% sure it has the exact answer you need, but just in case you haven't seen it there was a pretty extensive and up to date Blog post about Examine here
Examine OR Search
Hi Guys,
I've been trying to perform a search with examine using OR based criteria.. I have found if i search for 2 words or more it is trying to search for an exact match.. how would i make it perform an or based search?
Thanks,
Tom
Hey Tom,
Not 100% sure it has the exact answer you need, but just in case you haven't seen it there was a pretty extensive and up to date Blog post about Examine here
http://umbraco.com/follow-us/blog-archive/2011/9/16/examining-examine.aspx
Best of luck
Rich
Hey Tom
Maybe you can find some inspiration from this :
http://our.umbraco.org/forum/developers/extending-umbraco/19329-Search-multiple-fields-for-multiple-terms-with-examine
/Sune
Both answers were super helpful!
thanks so much guys!
I need to something like this:
and field1 = "0" or (field1 = "1" and field2 = "show")
but i'm really struggling to see how to do it.
I'm pretty sure this is not going to give me the results I want:
.And().Field("field1", "0").Or().Field("field", "1").And().Field("field2", "show"));
How do I prioritse the boolean operators?
Thanks, Matt
Matt,
Think for the second bit a grouped .And().Field("field1", "0").Or().GroupedAnd(arrOffields,arrayOfValues);
however i would write out the generated query then try and run it in luke (https://code.google.com/p/luke/) or examine inspector (http://our.umbraco.org/projects/backoffice-extensions/examine-inspector) see what you get
Regards
Ismial
is working on a reply...