Sharing ravendb Search with Where

I am executing a raven request in C # and using the extension methods Where () and Search (). I need both of these functions because I only need to return indexes with a specific Guid field and the text that exists in the text. Unfortunately, the Where extension method does not seem to be compatible with the search extension method. When I combine them, I get a Lucene request like this:

Query: FeedOwner:25eb541c\-b04a\-4f08\-b468\-65714f259ac2 MessageBody:<<request*>> 

Which, it seems, completely ignores some of the "MessageBody" criteria, so it does not matter what restriction I use in the "free text", it does not use it.

I tested only one "Search" and it works, so it is not a problem with free text search on its own, just combining the two.

+4
source share
1 answer

Thanks to @Tobias on Raven @GoogleGroups, which pointed me in the right direction, it became possible to determine how to combine Where and Search sentences:

 Query<T>.Search(candidate => candidate.MessageBody, queryString + "*", options: SearchOptions.And); 
+8
source

All Articles