I was wondering what is the best way to get the maximum value of an indexed
field?
For example I have a document with a field named "localTime" and i want to
take the maximum value of that field. Is the only way to do that the
StatisticsFacet getMax method? Can somehow filter the results to return to
me the document(s) that have this maximum value and then get the field I
want?
I was wondering what is the best way to get the maximum value of an
indexed field?
For example I have a document with a field named "localTime" and i want to
take the maximum value of that field. Is the only way to do that the
StatisticsFacet getMax method? Can somehow filter the results to return to
me the document(s) that have this maximum value and then get the field I
want?
I was wondering what is the best way to get the maximum value of an
indexed field?
For example I have a document with a field named "localTime" and i want
to take the maximum value of that field. Is the only way to do that the
StatisticsFacet getMax method? Can somehow filter the results to return to
me the document(s) that have this maximum value and then get the field I
want?
Thank you
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.
Thanks for the replies, very helpful! I was thinking the solution of the
reverse sorting, but I was wondering how fast n' efficient is this?
probably will go that direction (sorting) till the new feature Nik is
mentioning will be released..
T.
On 08/14/2013 10:09 PM, simonw wrote:
instead of faceting you can just do a reverse sort on that field?
simon
On Wednesday, August 14, 2013 6:58:59 PM UTC+2, Nikolas Everett wrote:
You may want to have a look at statistical facets. They are
building an aggregation module but I don't believe it has been
finished or released.
Nik
On Wed, Aug 14, 2013 at 12:54 PM, Thomas <thomas...@gmail.com
<javascript:>> wrote:
Hi,
I was wondering what is the best way to get the maximum value
of an indexed field?
For example I have a document with a field named "localTime"
and i want to take the maximum value of that field. Is the
only way to do that the StatisticsFacet getMax method? Can
somehow filter the results to return to me the document(s)
that have this maximum value and then get the field I want?
Thank you
--
You received this message because you are subscribed to the
Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from
it, send an email to elasticsearc...@googlegroups.com
<javascript:>.
For more options, visit
https://groups.google.com/groups/opt_out
<https://groups.google.com/groups/opt_out>.
@Thomas, reverse sorting is likely as efficient as it gets even in the
future. Aggregations will likely be slower.
simon
On Saturday, August 17, 2013 1:21:05 AM UTC+2, Thomas wrote:
Hi,
Thanks for the replies, very helpful! I was thinking the solution of the
reverse sorting, but I was wondering how fast n' efficient is this?
probably will go that direction (sorting) till the new feature Nik is
mentioning will be released..
T.
On 08/14/2013 10:09 PM, simonw wrote:
instead of faceting you can just do a reverse sort on that field?
simon
On Wednesday, August 14, 2013 6:58:59 PM UTC+2, Nikolas Everett wrote:
You may want to have a look at statistical facets. They are building an
aggregation module but I don't believe it has been finished or released.
I was wondering what is the best way to get the maximum value of an
indexed field?
For example I have a document with a field named "localTime" and i want
to take the maximum value of that field. Is the only way to do that the
StatisticsFacet getMax method? Can somehow filter the results to return to
me the document(s) that have this maximum value and then get the field I
want?
Thanks guys!
I contuinue with this and I implement the sort solution to get the maximum
value but I note something else; in the results i try to get the max value
returned of a date value like this:
java.util.Date max =
response.getHits().getHits()[0].field(field.getName()).getValue();
But the value returned is always string, (I have also tryied to do it with
a Long field). Is this correct? I note tha the signature of the getValue is
V getValue();
meaning tha should support my casting to Date since the field is declared
as date field, or I'm missing something:
@Thomas, reverse sorting is likely as efficient as it gets even in the
future. Aggregations will likely be slower.
simon
On Saturday, August 17, 2013 1:21:05 AM UTC+2, Thomas wrote:
Hi,
Thanks for the replies, very helpful! I was thinking the solution of the
reverse sorting, but I was wondering how fast n' efficient is this?
probably will go that direction (sorting) till the new feature Nik is
mentioning will be released..
T.
On 08/14/2013 10:09 PM, simonw wrote:
instead of faceting you can just do a reverse sort on that field?
simon
On Wednesday, August 14, 2013 6:58:59 PM UTC+2, Nikolas Everett wrote:
You may want to have a look at statistical facets. They are building an
aggregation module but I don't believe it has been finished or released.
I was wondering what is the best way to get the maximum value of an
indexed field?
For example I have a document with a field named "localTime" and i want
to take the maximum value of that field. Is the only way to do that the
StatisticsFacet getMax method? Can somehow filter the results to return to
me the document(s) that have this maximum value and then get the field I
want?
Thanks guys!
I contuinue with this and I implement the sort solution to get the maximum
value but I note something else; in the results i try to get the max value
returned of a date value like this:
java.util.Date max =
response.getHits().getHits()[0].field(field.getName()).getValue();
But the value returned is always string, (I have also tryied to do it with
a Long field). Is this correct? I note tha the signature of the getValue is
V getValue();
meaning tha should support my casting to Date since the field is declared
as date field, or I'm missing something:
@Thomas, reverse sorting is likely as efficient as it gets even in the
future. Aggregations will likely be slower.
simon
On Saturday, August 17, 2013 1:21:05 AM UTC+2, Thomas wrote:
Hi,
Thanks for the replies, very helpful! I was thinking the solution of the
reverse sorting, but I was wondering how fast n' efficient is this?
probably will go that direction (sorting) till the new feature Nik is
mentioning will be released..
T.
On 08/14/2013 10:09 PM, simonw wrote:
instead of faceting you can just do a reverse sort on that field?
simon
On Wednesday, August 14, 2013 6:58:59 PM UTC+2, Nikolas Everett wrote:
You may want to have a look at statistical facets. They are building
an aggregation module but I don't believe it has been finished or released.
I was wondering what is the best way to get the maximum value of an
indexed field?
For example I have a document with a field named "localTime" and i
want to take the maximum value of that field. Is the only way to do that
the StatisticsFacet getMax method? Can somehow filter the results to return
to me the document(s) that have this maximum value and then get the field I
want?
Thanks guys!
I contuinue with this and I implement the sort solution to get the
maximum value but I note something else; in the results i try to get the
max value returned of a date value like this:
java.util.Date max =
response.getHits().getHits()[0].field(field.getName()).getValue();
But the value returned is always string, (I have also tryied to do it
with a Long field). Is this correct? I note tha the signature of the
getValue is
V getValue();
meaning tha should support my casting to Date since the field is declared
as date field, or I'm missing something:
@Thomas, reverse sorting is likely as efficient as it gets even in the
future. Aggregations will likely be slower.
simon
On Saturday, August 17, 2013 1:21:05 AM UTC+2, Thomas wrote:
Hi,
Thanks for the replies, very helpful! I was thinking the solution of
the reverse sorting, but I was wondering how fast n' efficient is this?
probably will go that direction (sorting) till the new feature Nik is
mentioning will be released..
T.
On 08/14/2013 10:09 PM, simonw wrote:
instead of faceting you can just do a reverse sort on that field?
simon
On Wednesday, August 14, 2013 6:58:59 PM UTC+2, Nikolas Everett wrote:
You may want to have a look at statistical facets. They are building
an aggregation module but I don't believe it has been finished or released.
I was wondering what is the best way to get the maximum value of an
indexed field?
For example I have a document with a field named "localTime" and i
want to take the maximum value of that field. Is the only way to do that
the StatisticsFacet getMax method? Can somehow filter the results to return
to me the document(s) that have this maximum value and then get the field I
want?
Finally, I wasn't able to figure this out.. A possible bug?
Thanks
Tom
On Wednesday, August 14, 2013 7:54:21 PM UTC+3, Thomas wrote:
Hi,
I was wondering what is the best way to get the maximum value of an
indexed field?
For example I have a document with a field named "localTime" and i want to
take the maximum value of that field. Is the only way to do that the
StatisticsFacet getMax method? Can somehow filter the results to return to
me the document(s) that have this maximum value and then get the field I
want?
I am not sure I can follow you. What is a possible bug?
On Monday, August 19, 2013 7:10:52 PM UTC+2, Thomas wrote:
Finally, I wasn't able to figure this out.. A possible bug?
Thanks
Tom
On Wednesday, August 14, 2013 7:54:21 PM UTC+3, Thomas wrote:
Hi,
I was wondering what is the best way to get the maximum value of an
indexed field?
For example I have a document with a field named "localTime" and i want
to take the maximum value of that field. Is the only way to do that the
StatisticsFacet getMax method? Can somehow filter the results to return to
me the document(s) that have this maximum value and then get the field I
want?
What i mean is that i try to retrieve the value as a date but the actual
value is of type string, having as a result a cast exception:
java.util.Date date =
response.getHits().getHits()[0].field("logDate").getValue(); // Although in
my mapping the field is of type date, the value returned is of type String
For other java types this works fine:
Double counter =
response.getHits().getHits()[0].field("counter").getValue(); // Works fine
Does this makes sense?
thanks again
T.
On Wednesday, 14 August 2013 19:54:21 UTC+3, Thomas wrote:
Hi,
I was wondering what is the best way to get the maximum value of an
indexed field?
For example I have a document with a field named "localTime" and i want to
take the maximum value of that field. Is the only way to do that the
StatisticsFacet getMax method? Can somehow filter the results to return to
me the document(s) that have this maximum value and then get the field I
want?
Unfortunately we can't return this as a date at this point. You have to
parse the string back into a date. This is expected behavior.
simon
On Monday, August 19, 2013 9:11:14 PM UTC+2, Thomas wrote:
Hi Simonw,
Sorry for not explaining well,
What i mean is that i try to retrieve the value as a date but the actual
value is of type string, having as a result a cast exception:
java.util.Date date =
response.getHits().getHits()[0].field("logDate").getValue(); // Although in
my mapping the field is of type date, the value returned is of type String
For other java types this works fine:
Double counter =
response.getHits().getHits()[0].field("counter").getValue(); // Works fine
Does this makes sense?
thanks again
T.
On Wednesday, 14 August 2013 19:54:21 UTC+3, Thomas wrote:
Hi,
I was wondering what is the best way to get the maximum value of an
indexed field?
For example I have a document with a field named "localTime" and i want
to take the maximum value of that field. Is the only way to do that the
StatisticsFacet getMax method? Can somehow filter the results to return to
me the document(s) that have this maximum value and then get the field I
want?
Thank you again for your help, yes this is the case I return it as a String
and parse it back to Date
Tom
On Wednesday, August 14, 2013 7:54:21 PM UTC+3, Thomas wrote:
Hi,
I was wondering what is the best way to get the maximum value of an
indexed field?
For example I have a document with a field named "localTime" and i want to
take the maximum value of that field. Is the only way to do that the
StatisticsFacet getMax method? Can somehow filter the results to return to
me the document(s) that have this maximum value and then get the field I
want?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.