Examine
Examine copied to clipboard
Multiple fields and a broken link
On page https://shazwazza.github.io/Examine/searching , we can search by specific field:
_var searcher = myIndex.GetSearcher(); // Get a searcher
var results = searcher.CreateQuery() // Create a query
.Field("Address", "Hills") // Look for any "Hills" addresses
.Execute(); // Execute the search
But, can we use multiple fields? Like:
_var searcher = myIndex.GetSearcher(); // Get a searcher
var results = searcher.CreateQuery() // Create a query
.Field("Name", "Frank") // Look for any "Frank" names
.Field("Address", "Hills") // Look for any "Hills" addresses
.Execute(); // Execute the search
BTW: the link on that page to https://github.com/Shazwazza/Examine/blob/master/src/Examine.Test/Search/FluentApiTests.cs is broken.
Yes you can definitely search on multiple fields.
The FluentApiTests are here https://github.com/Shazwazza/Examine/blob/dev/src/Examine.Test/Examine.Lucene/Search/FluentApiTests.cs
There are tons of different searching examples there.
The docs could definitely use some more love and would be great if you or anyone could help contribute to them. They are very easy to edit, can even be done directly on GitHub by editing the files, for example, this is the searching file: https://github.com/Shazwazza/Examine/blob/master/docs/searching.md