c# - Search Query with Nest ElasticSearch having AND operator -
I'm trying the following text:
"Women were organized" (note " "Has been added for text presentation)
All the items I need from the above text include the word" woman "and" organized "from the area stored in elastic index.
Did I try:
string searchText = "women were organized"; Var filterQuery = Query & lt; T & gt; Rule ("summary text", searchText.Split ('')); Var Results = Client Search & lt; T & gt; (S = & gt; s.Index (IndexName) .Query (filterQuery). Size (1000));
But the result of the above query is found in the form of "woman" or "organized" from the "summary" field, but what do I need is "women and organized" means both lessons "summary text "Be present in the field.
Please tell me what it means, I have tried many combinations, but still have not succeeded. Can anybody help nest guru?
If you want an exact match for "organized woman" an area does not divide the string Is:
string search text = "women organized"; Var filterQuery = Query & lt; T & gt; Rule ("summary text", search text); Var Results = Client Search & lt; T & gt; (S = & gt; s.Index (IndexName) .Query (filterQuery). Size (1000)); If you are searching for "Included" functionality, then you need to use a query (but if your data is large then there is a display overhead for it). : search descriptor & lt; T & gt; Description = new search descriptor & lt; T & gt; (); Descriptor = descriptor.Index (IndexName). Size (1000). Sign (query = & gt; query .Regexp (r = & gt; r.OnField ("summary text"). Value ("." + "Female" + ". *")))); Var Results = Elastic Client (). Search & lt; T & gt; (S = & gt; Descriptor);
Comments
Post a Comment