I want to search documents in RavenDB and make the search results more precise for each word searched.
This is my current code (simplified). For each iteration in the loop I want to make and "and" clause. How is that possible?
At the moment I just get more results for each word, but I want to get less results per word.
using (var session = this.ravenSession.Store.OpenAsyncSession())
{
var query = session.Query<TestDocument, TestIndex>();
foreach (string word in search.Split(' '))
{
query = query.Search(x => x.Brand, word, boost: 5)
.Search(x => x.Model, word, boost: 3)
.Search(x => x.Variant, word)
.Search(x => x.Color, word);
}
}