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:

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 Elasticsearch Platform — Find real-time answers at scale | Elastic?

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

Otis

ELASTICSEARCH Performance Monitoring - Sematext Monitoring | Infrastructure Monitoring Service
Search Analytics - Cloud Monitoring Tools & Services | Sematext

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:

Elasticsearch Platform — Find real-time answers at scale | Elastic

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
Elasticsearch Platform — Find real-time answers at scale | Elastic
?

Looks like SuoNayi is exploring Solr vs. ES?
If so, here is how they compare when it comes to faceting:
Solr vs Elasticsearch: Performance Differences & More - Sematext

Otis

ELASTICSEARCH Performance Monitoring - Sematext Monitoring | Infrastructure Monitoring Service
Search Analytics - Cloud Monitoring Tools & Services | Sematext

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:
Elasticsearch Platform — Find real-time answers at scale | Elastic**
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

--

--

--