Nest Query taking much longer than direct Json Query


#1

Hi there.
I am using NEST in my C# program, and this is producing a lot more of a delay than I'd expect, considering the time it takes to make the same request directly.

Both the site and elastic search server are running on my local machine, so there's no bandwidth considerations.

The C# version of the query is as follows...

client.Search<CustomerDocumentAutoCompletes>(new SearchRequest()
        {
            Size = 20,
            From = 0,
            Query = new MatchQuery()
            {
                Query = searchTerms.ToLower(),
                Analyzer = "standard",
                Field = "nameAddress",
                Fuzziness = Fuzziness.Auto,
                FuzzyTranspositions = true,
                Operator = Operator.And
                }
            }
        );

and the Json query I am comparing with is thus:

{
	"size": 20
	"query": {
		"fuzzy":{
			"nameAddress":{
				"value": "Londen"
				
			}
		}
	}
}

(London is spelled incorrectly for fuzziness reasons)

The NEST request is taking anywhere from 180ms to 300ms, where as the json request is taking around 20ms. Because of my use case (autocomplete on a textbox) I need this to be as fast as possible.

Thanks.


(system) #2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.