Examine : Querying against multiple ISearchCriteria
I am using the Fluent API to create a search filer. Something like
var fluentSearchFilter = searchCriteria.NodeTypeAlias("SomeAlias")
.And()
.Field("SomeFieldAlias", someValue);
var results = umbracoHelper.TypedSearch(fluentSearchFilter.Compile()); //This works fine
This works fine and I get the results I want / should get with the query.
I also need to use raw lucene queries for something that's a bit more complex and that the fluent API doesn't cover. Once again, this is fine :
var rawSearchFilter = searchCriteria.RawQuery(myComplexRawQuery); var results = umbracoHelper.TypedSearch(rawSearchFilter);
Now what I would like to do is combine the 2 ISearchCriteria objects. Basically, one query that will return the results that satisfy both fluentSearchFilter and rawSearchFilterÂ. Is there a way to create a ISearchCriteria from 2 ISearchCriteria objects like that?
If there isn't, I am guessing that I will need to take the first ISearchCriteria (the one that I create with the fluent API), get the Lucene query from it and then create one big Lucene query by combining it to myComplexRawQuery. But once again, I am not sure how to even get the raw lucene query from an existing ISearchCriteria.
I know this sounds like i'm not really trying... I can see it in Visual Studio but I just can't figure out how to get the string!
Does anyone know how to do this or how to achieve an equivalent result?
Examine : Querying against multiple ISearchCriteria
I am using the Fluent API to create a search filer. Something like
This works fine and I get the results I want / should get with the query.
I also need to use raw lucene queries for something that's a bit more complex and that the fluent API doesn't cover. Once again, this is fine :
Now what I would like to do is combine the 2 ISearchCriteria objects. Basically, one query that will return the results that satisfy both fluentSearchFilter and rawSearchFilterÂ. Is there a way to create a ISearchCriteria from 2 ISearchCriteria objects like that?
If there isn't, I am guessing that I will need to take the first ISearchCriteria (the one that I create with the fluent API), get the Lucene query from it and then create one big Lucene query by combining it to myComplexRawQuery. But once again, I am not sure how to even get the raw lucene query from an existing ISearchCriteria.
I know this sounds like i'm not really trying... I can see it in Visual Studio but I just can't figure out how to get the string!
Does anyone know how to do this or how to achieve an equivalent result?
Thanks a lot!!
is working on a reply...