Examine - Search where A or (B and C) - Nested Queries
Hi,
I'm attempting to perform a search in v8's version of Examine using the fluent api. However, I'm trying to add filtering to my search to reduce down the number of unrequired results. To do this I want to search as follows:
Where (ItemType = Content) or (ItemType = Media and File Extension = PDF)
And as a result this returns 0 results which is not what I'm expecting.
If I use LUKE to query the index directly and I remove the first + from highlighted part of the query then I get the results I'm expecting. Any one got ideas on how I can get my nested query to generate without the first + ?
So in V8, you can do it at the very start of the creation of a query, you can set the default boolean operation, but you don't seem to be able to do that in a nested query. Despite you getting the option to pass you choice in when calling the Group method.
It's odd, I think I have to go with the raw query approach though even though it's not as nice to read imo.
Thanks for you help :-) Hadn't thought of trying mixing a raw query with the rest of the fluent api before :-)
Examine - Search where A or (B and C) - Nested Queries
Hi,
I'm attempting to perform a search in v8's version of Examine using the fluent api. However, I'm trying to add filtering to my search to reduce down the number of unrequired results. To do this I want to search as follows:
(ItemType = Content)
or(ItemType = Media and File Extension = PDF)
To do this I'm doing the following:
In theory, this looks correct but the start of my actual lucene query ends up looking like this:
(+__IndexType:content (+__IndexType:media +umbracoExtension:pdf))
And as a result this returns 0 results which is not what I'm expecting.
If I use LUKE to query the index directly and I remove the first + from highlighted part of the query then I get the results I'm expecting. Any one got ideas on how I can get my nested query to generate without the first + ?
Thanks
Nik
So in v7 or older examine you would let the boolean operation to OR rather than and. So you could try something similar not sure how though.
Or worse case just use raw query, so:
Regards
Ismail
So in V8, you can do it at the very start of the creation of a query, you can set the default boolean operation, but you don't seem to be able to do that in a nested query. Despite you getting the option to pass you choice in when calling the Group method.
It's odd, I think I have to go with the raw query approach though even though it's not as nice to read imo.
Thanks for you help :-) Hadn't thought of trying mixing a raw query with the rest of the fluent api before :-)
is working on a reply...