Elastic search performance

(Madhan Kumar) #1

i need to retrieve 5000 records as single shot in elastic search querystring.

so i mention .size(5000) but it takes too long time and throws exception as "The operation timed out".

How to resolve this issue and boost up search.

pls guide me its an urgent request.

(Ed) #2

how are you doing the query? curl, javascript, kibana and can you provide an example of the query.

until you get back to me read the docs, all the above have a timeout option which you can change.

but 5000 is not really big there is probably ways of optimizing your search to make it run quicker.

(David Pilato) #3

May be the source document is too big?
Try using fields or stored_fields in your request to replace _source with another field name and see if it's faster?

(Madhan Kumar) #4
> var response = client.Search<ElasticSearchModel>(s => s
>                            .Index(ElasticIndex)`                                     
>                            .From(0)
>                            .Size(5000)
>                            .QueryString(type1.Id:(*) AND type1.active:("1"))
>                            .SortAscending(type1.Id));

this is my search query.. it takes too long time and throws exception.

(Ed) #5

well besides looking at the timeout setting in java. that will let you wait longer for a response

how big is your cluster ,?
how big is your index?
what is your shared count?
what is your load average? howmany cpu's
what is your heap size and what is it corrently at

your query is pretty simple, you might want to use filters instead of queries as they will reduce the data faster and it becomes cached

i also suggest you find more fields to reduces thr amount of data you are processing

but if your not able to optimize the query your going to have to look at why your cluster is so slow.

(Ed) #6

Try this, client.prepareSearch().setTimeout("1ms").execute().actionGet();

(system) #7

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