lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luis Fco. Ramriez Daza Glez" <luisfc...@yahoo.com.mx>
Subject How to get the "greater" term/word in a single-word numeric field
Date Thu, 21 Jan 2010 18:31:54 GMT
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


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message