Examine icon indicating copy to clipboard operation
Examine copied to clipboard

Multiple fields and a broken link

Open wilsonchenbhs opened this issue 3 years ago • 1 comments
trafficstars

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.

wilsonchenbhs avatar Mar 10 '22 02:03 wilsonchenbhs

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

Shazwazza avatar Mar 22 '22 23:03 Shazwazza