Created
May 26, 2020 23:03
-
-
Save JimBobSquarePants/f07c60bd281614bf3f018de8c595c7ee to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a query where the result must match or contain the given query | |
// and the subset of properties and filters. | |
descriptor.Query( | |
q => q.Bool( | |
b => b.Must( | |
mu => | |
mu.MultiMatch( | |
m => m.Fields(propertyExpressions) // Search within these properties or all. | |
.Query(searchTerm) // For this query | |
.Operator(Operator.Or))) // In any of the properties. | |
.Filter(filters))); // Further filter results. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not sure if you've seen. but the elasticsearch-net-example repository has an example of filtering nuget packages by authors and tags
https://github.com/elastic/elasticsearch-net-example/blob/5.x-codecomplete-netcore-modifications/src/NuSearch.Web/Modules/Search/Search/SearchController.cs