Skip to content

Instantly share code, notes, and snippets.

@JimBobSquarePants
Created May 26, 2020 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JimBobSquarePants/f07c60bd281614bf3f018de8c595c7ee to your computer and use it in GitHub Desktop.
Save JimBobSquarePants/f07c60bd281614bf3f018de8c595c7ee to your computer and use it in GitHub Desktop.
// 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