Hi all

 

I have an index some field that each one has a single integer number.

I want to get the greatest value of this field in all my documents.

What is the best way to get it for both, numeric value stored as string 
(without padding zeros) and numeric value stored as number?

 

Since I don’t have a better choice I had been getting ALL documents and sorting 
them by this field to get the greatest and the lowest:

[pseudo code]

Hits = SELECT * FROM MyIndex ORDER BY MyFiled DESC

Value = Hits.doc(0).get(“MyField”)

 

But what I realy want is something like the SQL equiv of:

SELECT MAX(MyField) FROM MyIndex

Or

SELECT MIN(MyField) FROM MyIndex

 

Kind regards

Luis

Reply via email to