Reading up on
Searching in RavenDB...
This method allows you to pass a few search terms that will be used in searching process for a particular field. Here is a sample code that uses Search
extension to get users with name John or Adam:
?1 | users = session.Query<User>( "UsersByName" ).Search(x => x.Name, "John Adam" ).ToList();
|
Each of search terms (separated by space character) will be checked independently. The result documents must match exact one of the passed terms.
Simple.
But what happens if I wish to search for "John" and "Adam" and "Jane Citizen" ? (and Jane Citizen is a value in the 'terms')
I tried doing this..
var query = "John adam \'jane citizen\""
var results = asyncDocumentSession.Query<Index.Result, Index>().Search(x => x.Query, query).ToListAsync();
(NOTE: not doing a wildcard search (ie. starts with) but an exact search against the terms).
but that didn't return the result i was after.
any suggestions, please?
-J-