В поиске участвуют два запроса. Первый(медленный) выбирает id всех товаров, второй агрегирует все поля для 25 товаров одной страницы. ::: [Thanos][_TtRMVdJSZqZ0tZfLN5hGw][ip-10-75-42-211][inet[/54.73.189.201:9300]] Hot threads at 2015-05-08T16:35:36.763Z, interval=500ms, busiestThreads=3, ignoreIdleThreads=true: 53.6% (268ms out of 500ms) cpu usage by thread 'elasticsearch[Thanos][search][T#3]' 4/10 snapshots sharing following 20 elements org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator$WithHash.getBucketOrd(GlobalOrdinalsStringTermsAggregator.java:304) org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.buildAggregation(GlobalOrdinalsStringTermsAggregator.java:160) org.elasticsearch.search.aggregations.Aggregator.gatherAnalysis(Aggregator.java:362) org.elasticsearch.search.aggregations.AggregatorFactories$1.gatherAnalysis(AggregatorFactories.java:143) org.elasticsearch.search.aggregations.bucket.BucketsAggregator.bucketAggregations(BucketsAggregator.java:122) org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.buildAggregation(GlobalOrdinalsStringTermsAggregator.java:195) org.elasticsearch.search.aggregations.Aggregator.gatherAnalysis(Aggregator.java:362) org.elasticsearch.search.aggregations.AggregatorFactories$1.gatherAnalysis(AggregatorFactories.java:143) org.elasticsearch.search.aggregations.bucket.BucketsAggregator.bucketAggregations(BucketsAggregator.java:122) org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.buildAggregation(GlobalOrdinalsStringTermsAggregator.java:195) org.elasticsearch.search.aggregations.AggregationPhase.execute(AggregationPhase.java:134) org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:172) org.elasticsearch.search.SearchService.loadOrExecuteQueryPhase(SearchService.java:286) org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:297) org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:231) org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:228) org.elasticsearch.search.action.SearchServiceTransportAction$23.run(SearchServiceTransportAction.java:559) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) java.lang.Thread.run(Thread.java:745) 5/10 snapshots sharing following 19 elements org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.buildAggregation(GlobalOrdinalsStringTermsAggregator.java:156) org.elasticsearch.search.aggregations.Aggregator.gatherAnalysis(Aggregator.java:362) org.elasticsearch.search.aggregations.AggregatorFactories$1.gatherAnalysis(AggregatorFactories.java:143) org.elasticsearch.search.aggregations.bucket.BucketsAggregator.bucketAggregations(BucketsAggregator.java:122) org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.buildAggregation(GlobalOrdinalsStringTermsAggregator.java:195) org.elasticsearch.search.aggregations.Aggregator.gatherAnalysis(Aggregator.java:362) org.elasticsearch.search.aggregations.AggregatorFactories$1.gatherAnalysis(AggregatorFactories.java:143) org.elasticsearch.search.aggregations.bucket.BucketsAggregator.bucketAggregations(BucketsAggregator.java:122) org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.buildAggregation(GlobalOrdinalsStringTermsAggregator.java:195) org.elasticsearch.search.aggregations.AggregationPhase.execute(AggregationPhase.java:134) org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:172) org.elasticsearch.search.SearchService.loadOrExecuteQueryPhase(SearchService.java:286) org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:297) org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:231) org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:228) org.elasticsearch.search.action.SearchServiceTransportAction$23.run(SearchServiceTransportAction.java:559) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) java.lang.Thread.run(Thread.java:745) unique snapshot org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.buildAggregation(GlobalOrdinalsStringTermsAggregator.java:160) org.elasticsearch.search.aggregations.Aggregator.gatherAnalysis(Aggregator.java:362) org.elasticsearch.search.aggregations.AggregatorFactories$1.gatherAnalysis(AggregatorFactories.java:143) org.elasticsearch.search.aggregations.bucket.BucketsAggregator.bucketAggregations(BucketsAggregator.java:122) org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.buildAggregation(GlobalOrdinalsStringTermsAggregator.java:195) org.elasticsearch.search.aggregations.Aggregator.gatherAnalysis(Aggregator.java:362) org.elasticsearch.search.aggregations.AggregatorFactories$1.gatherAnalysis(AggregatorFactories.java:143) org.elasticsearch.search.aggregations.bucket.BucketsAggregator.bucketAggregations(BucketsAggregator.java:122) org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.buildAggregation(GlobalOrdinalsStringTermsAggregator.java:195) org.elasticsearch.search.aggregations.AggregationPhase.execute(AggregationPhase.java:134) org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:172) org.elasticsearch.search.SearchService.loadOrExecuteQueryPhase(SearchService.java:286) org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:297) org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:231) org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:228) org.elasticsearch.search.action.SearchServiceTransportAction$23.run(SearchServiceTransportAction.java:559) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) java.lang.Thread.run(Thread.java:745) 49.2% (245.9ms out of 500ms) cpu usage by thread 'elasticsearch[Thanos][search][T#1]' 5/10 snapshots sharing following 20 elements org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator$WithHash.getBucketOrd(GlobalOrdinalsStringTermsAggregator.java:304) org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.buildAggregation(GlobalOrdinalsStringTermsAggregator.java:160) org.elasticsearch.search.aggregations.Aggregator.gatherAnalysis(Aggregator.java:362) org.elasticsearch.search.aggregations.AggregatorFactories$1.gatherAnalysis(AggregatorFactories.java:143) org.elasticsearch.search.aggregations.bucket.BucketsAggregator.bucketAggregations(BucketsAggregator.java:122) org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.buildAggregation(GlobalOrdinalsStringTermsAggregator.java:195) org.elasticsearch.search.aggregations.Aggregator.gatherAnalysis(Aggregator.java:362) org.elasticsearch.search.aggregations.AggregatorFactories$1.gatherAnalysis(AggregatorFactories.java:143) org.elasticsearch.search.aggregations.bucket.BucketsAggregator.bucketAggregations(BucketsAggregator.java:122) org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.buildAggregation(GlobalOrdinalsStringTermsAggregator.java:195) org.elasticsearch.search.aggregations.AggregationPhase.execute(AggregationPhase.java:134) org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:172) org.elasticsearch.search.SearchService.loadOrExecuteQueryPhase(SearchService.java:286) org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:297) org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:231) org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:228) org.elasticsearch.search.action.SearchServiceTransportAction$23.run(SearchServiceTransportAction.java:559) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) java.lang.Thread.run(Thread.java:745) 4/10 snapshots sharing following 19 elements org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.buildAggregation(GlobalOrdinalsStringTermsAggregator.java:156) org.elasticsearch.search.aggregations.Aggregator.gatherAnalysis(Aggregator.java:362) org.elasticsearch.search.aggregations.AggregatorFactories$1.gatherAnalysis(AggregatorFactories.java:143) org.elasticsearch.search.aggregations.bucket.BucketsAggregator.bucketAggregations(BucketsAggregator.java:122) org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.buildAggregation(GlobalOrdinalsStringTermsAggregator.java:195) org.elasticsearch.search.aggregations.Aggregator.gatherAnalysis(Aggregator.java:362) org.elasticsearch.search.aggregations.AggregatorFactories$1.gatherAnalysis(AggregatorFactories.java:143) org.elasticsearch.search.aggregations.bucket.BucketsAggregator.bucketAggregations(BucketsAggregator.java:122) org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.buildAggregation(GlobalOrdinalsStringTermsAggregator.java:195) org.elasticsearch.search.aggregations.AggregationPhase.execute(AggregationPhase.java:134) org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:172) org.elasticsearch.search.SearchService.loadOrExecuteQueryPhase(SearchService.java:286) org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:297) org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:231) org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:228) org.elasticsearch.search.action.SearchServiceTransportAction$23.run(SearchServiceTransportAction.java:559) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) java.lang.Thread.run(Thread.java:745) unique snapshot org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.buildAggregation(GlobalOrdinalsStringTermsAggregator.java:160) org.elasticsearch.search.aggregations.Aggregator.gatherAnalysis(Aggregator.java:362) org.elasticsearch.search.aggregations.AggregatorFactories$1.gatherAnalysis(AggregatorFactories.java:143) org.elasticsearch.search.aggregations.bucket.BucketsAggregator.bucketAggregations(BucketsAggregator.java:122) org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.buildAggregation(GlobalOrdinalsStringTermsAggregator.java:195) org.elasticsearch.search.aggregations.Aggregator.gatherAnalysis(Aggregator.java:362) org.elasticsearch.search.aggregations.AggregatorFactories$1.gatherAnalysis(AggregatorFactories.java:143) org.elasticsearch.search.aggregations.bucket.BucketsAggregator.bucketAggregations(BucketsAggregator.java:122) org.elasticsearch.search.aggregations.bucket.terms.GlobalOrdinalsStringTermsAggregator.buildAggregation(GlobalOrdinalsStringTermsAggregator.java:195) org.elasticsearch.search.aggregations.AggregationPhase.execute(AggregationPhase.java:134) org.elasticsearch.search.query.QueryPhase.execute(QueryPhase.java:172) org.elasticsearch.search.SearchService.loadOrExecuteQueryPhase(SearchService.java:286) org.elasticsearch.search.SearchService.executeQueryPhase(SearchService.java:297) org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:231) org.elasticsearch.search.action.SearchServiceTransportAction$5.call(SearchServiceTransportAction.java:228) org.elasticsearch.search.action.SearchServiceTransportAction$23.run(SearchServiceTransportAction.java:559) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) java.lang.Thread.run(Thread.java:745)
1.5.2
--
Вы получили это сообщение, поскольку подписаны на одну из тем в группе "elasticsearch-ru".
Чтобы отменить подписку на эту тему, перейдите по ссылке https://groups.google.com/d/topic/elasticsearch-ru/oxgBTHqb49k/unsubscribe.
Чтобы отменить подписку на эту группу и все ее темы, отправьте письмо на электронный адрес elasticsearch-...@googlegroups.com.
Чтобы отправлять сообщения в эту группу, отправьте письмо на электронный адрес elastics...@googlegroups.com.
Чтобы зайти в группу, перейдите по ссылке http://groups.google.com/group/elasticsearch-ru.
Чтобы настроить другие параметры, перейдите по ссылке https://groups.google.com/d/optout.
--
Вы получили это сообщение, поскольку подписаны на одну из тем в группе "elasticsearch-ru".
Чтобы отменить подписку на эту тему, перейдите по ссылке https://groups.google.com/d/topic/elasticsearch-ru/oxgBTHqb49k/unsubscribe.
Чтобы отменить подписку на эту группу и все ее темы, отправьте письмо на электронный адрес elasticsearch-...@googlegroups.com.
Чтобы отправлять сообщения в эту группу, отправьте письмо на электронный адрес elastics...@googlegroups.com.
Чтобы зайти в группу, перейдите по ссылке http://groups.google.com/group/elasticsearch-ru.
Чтобы настроить другие параметры, перейдите по ссылке https://groups.google.com/d/optout.
А нельзя ли сделать инкреметный id и по нему фильтровать выдачу как пагинацию. Но группировку всех данных не избежать
суббота, 23 мая 2015 г. пользователь Николай Измайлов написал:
> Каждый раз увеличивая size при этом у вас данных возвращаться все больше записей
>
> суббота, 23 мая 2015 г. пользователь Серёжа Молодец написал:
>> Мы отказались от постранички, берем первую страницу, затем подгружаем по запросу еще результаты.
>> 23 мая 2015 г., 14:00 пользователь Николай Измайлов <nekul...@gmail.com> написал:
>>>
>>> Подскажите а как можно сделать пагинацию ? Что то вроде
>>> SELECT user_id, SUM(amount) FROM orders WHERE parent_id=1 GROUP BY user_id
>>> LIMIT 10, 300
>>> Сейчас в агрегации можно передавать только size и можно ли указать типа индекса для более быстрой агрегации.
>>> Спасио!
>>>
>>> --
>>> Вы получили это сообщение, поскольку подписаны на одну из тем в группе "elasticsearch-ru".
>>> Чтобы отменить подписку на эту тему, перейдите по ссылке https://groups.google.com/d/topic/elasticsearch-ru/oxgBTHqb49k/unsubscribe.
>>> Чтобы отменить подписку на эту группу и все ее темы, отправьте письмо на электронный адрес elasticsearch-ru+unsubscribe@googlegroups.com.
>>> Чтобы отправлять сообщения в эту группу, отправьте письмо на электронный адрес elasticsearch-ru@googlegroups.com.
>>> Чтобы зайти в группу, перейдите по ссылке http://groups.google.com/group/elasticsearch-ru.
>>> Чтобы настроить другие параметры, перейдите по ссылке https://groups.google.com/d/optout.
>>
>>
>>
>> --
>> С уважением, Сергей.
>>
>> --
>> Вы получили это сообщение, поскольку подписаны на одну из тем в группе "elasticsearch-ru".
>> Чтобы отменить подписку на эту тему, перейдите по ссылке https://groups.google.com/d/topic/elasticsearch-ru/oxgBTHqb49k/unsubscribe.
>> Чтобы отменить подписку на эту группу и все ее темы, отправьте письмо на электронный адрес elasticsearch-ru+unsubscribe@googlegroups.com.
>> Чтобы отправлять сообщения в эту группу, отправьте письмо на электронный адрес elasticsearch-ru@googlegroups.com.