How to retrieve the maximum id for one type index effectively?

Hi all,how to retrieve the maximum id for one type index effectively?
What I only know is to search with sort on the id field but in production
there are millions of documents in the index so this approach may suffer
from the penalty on performance.
Could someone share your best practice for this issue?

Thanks,
SuoNayi

--

Hello,

If your _id is a numeric value, you can use the Custom Score query, which
should be faster:
http://www.elasticsearch.org/guide/reference/query-dsl/custom-score-query.html

Otherwise, I think you're stuck with sorting. Unless you specify the ID, ES
assigns a random one for you. Therefore, sorting IDs is pretty much like
sorting any other field.

Best regards,
Radu

http://sematext.com/ -- ElasticSearch -- Solr -- Lucene

On Mon, Dec 17, 2012 at 4:29 PM, SuoNayi suonayi@gmail.com wrote:

Hi all,how to retrieve the maximum id for one type index effectively?
What I only know is to search with sort on the id field but in production
there are millions of documents in the index so this approach may suffer
from the penalty on performance.
Could someone share your best practice for this issue?

Thanks,
SuoNayi

--

--

Hi,

Or
maybe http://www.elasticsearch.org/guide/reference/api/search/facets/statistical-facet.html?

Looks like SuoNayi is exploring Solr vs. ES?
If so, here is how they compare when it comes to faceting:

Otis

ELASTICSEARCH Performance Monitoring - http://sematext.com/spm/index.html
Search Analytics - http://sematext.com/search-analytics/index.html

On Monday, December 17, 2012 12:39:42 PM UTC-5, Radu Gheorghe wrote:

Hello,

If your _id is a numeric value, you can use the Custom Score query, which
should be faster:

http://www.elasticsearch.org/guide/reference/query-dsl/custom-score-query.html

Otherwise, I think you're stuck with sorting. Unless you specify the ID,
ES assigns a random one for you. Therefore, sorting IDs is pretty much like
sorting any other field.

Best regards,
Radu

http://sematext.com/ -- ElasticSearch -- Solr -- Lucene

On Mon, Dec 17, 2012 at 4:29 PM, SuoNayi <suo...@gmail.com <javascript:>>wrote:

Hi all,how to retrieve the maximum id for one type index effectively?
What I only know is to search with sort on the id field but in production
there are millions of documents in the index so this approach may suffer
from the penalty on performance.
Could someone share your best practice for this issue?

Thanks,
SuoNayi

--

--

thanks guys, I am doing a performance test on them and if there already
exist some performance tests on them please tell me.
I'm only measuring them by writing index performance and it's hard to do
search index compare because there are many search approaches.
What I'm really to do is a choice decision between solrcloud and es.

2012/12/18 Otis Gospodnetic otis.gospodnetic@gmail.com

Hi,

Or maybe
http://www.elasticsearch.org/guide/reference/api/search/facets/statistical-facet.html
?

Looks like SuoNayi is exploring Solr vs. ES?
If so, here is how they compare when it comes to faceting:
http://blog.sematext.com/2012/10/30/solr-vs-elasticsearch-part-4-faceting/

Otis

ELASTICSEARCH Performance Monitoring - http://sematext.com/spm/index.html
Search Analytics - http://sematext.com/search-analytics/index.html

On Monday, December 17, 2012 12:39:42 PM UTC-5, Radu Gheorghe wrote:

Hello,

If your _id is a numeric value, you can use the Custom Score query, which
should be faster:
http://www.elasticsearch.org/guide/reference/query-dsl/
custom-score-query.htmlhttp://www.elasticsearch.org/guide/reference/query-dsl/custom-score-query.html

Otherwise, I think you're stuck with sorting. Unless you specify the ID,
ES assigns a random one for you. Therefore, sorting IDs is pretty much like
sorting any other field.

Best regards,
Radu

http://sematext.com/ -- ElasticSearch -- Solr -- Lucene

On Mon, Dec 17, 2012 at 4:29 PM, SuoNayi suo...@gmail.com wrote:

Hi all,how to retrieve the maximum id for one type index effectively?
What I only know is to search with sort on the id field but in
production there are millions of documents in the index so this approach
may suffer from the penalty on performance.
Could someone share your best practice for this issue?

Thanks,
SuoNayi

--

--

--