I do not think it is possible to get the date/time of the last time an
index was updated. Perhaps someone can prove otherwise. I would be a
bit tough in a distributed environment.
For info on the fields, you can use the mapping API:
Fields that are not explicitly defined in your initial mapping will be
added dynamically to the mapping. The GET mapping call will contain
all fields.
We manually store timestamps for creation and last update of our indices
within the "_meta" tag of a mapping. Then we use "Get Mapping" to fetch
these timestamps.
An alternative is to use the new timestamps[1] of the documents in the
index and search on that field, maybe using the term_stats facet to obtain
the max...
Hope it helps,
Philippe
[1]
On Thu, Dec 29, 2011 at 12:38, Ivan Brusic ivan@brusic.com wrote:
Mayer,
I do not think it is possible to get the date/time of the last time an
index was updated. Perhaps someone can prove otherwise. I would be a
bit tough in a distributed environment.
For info on the fields, you can use the mapping API:
We manually store timestamps for creation and last update of our indices
within the "_meta" tag of a mapping. Then we use "Get Mapping" to fetch
these timestamps.
An alternative is to use the new timestamps[1] of the documents in the
index and search on that field, maybe using the term_stats facet to obtain
the max...
On Thu, Dec 29, 2011 at 12:38, Ivan Brusic ivan@brusic.com wrote:
Mayer,
I do not think it is possible to get the date/time of the last time an
index was updated. Perhaps someone can prove otherwise. I would be a
bit tough in a distributed environment.
For info on the fields, you can use the mapping API:
Yes, that's what we ended up with. At the time, the document timestamps
didn't exist. I wasn't aware that updating the mapping was expensive. Is
this the case even when it's not chagning at all (except under _meta)?
Philippe
On Fri, Dec 30, 2011 at 10:06, Shay Banon kimchy@gmail.com wrote:
Storing the last update in the _meta part of the mapping? So does that
mean that for each document indexed, you update the mapping? Thats
expensive...
We manually store timestamps for creation and last update of our indices
within the "_meta" tag of a mapping. Then we use "Get Mapping" to fetch
these timestamps.
An alternative is to use the new timestamps[1] of the documents in the
index and search on that field, maybe using the term_stats facet to obtain
the max...
On Thu, Dec 29, 2011 at 12:38, Ivan Brusic ivan@brusic.com wrote:
Mayer,
I do not think it is possible to get the date/time of the last time an
index was updated. Perhaps someone can prove otherwise. I would be a
bit tough in a distributed environment.
For info on the fields, you can use the mapping API:
Well, expensive in the sense that it needs to be broadcasted to the cluster
and persisted (the whole metadata). Even without the timestamp feature, you
can add a timestamp to a document indexed, and find the latest one, you
don't need the timestamp to have that ability.
Yes, that's what we ended up with. At the time, the document timestamps
didn't exist. I wasn't aware that updating the mapping was expensive. Is
this the case even when it's not chagning at all (except under _meta)?
Philippe
On Fri, Dec 30, 2011 at 10:06, Shay Banon kimchy@gmail.com wrote:
Storing the last update in the _meta part of the mapping? So does that
mean that for each document indexed, you update the mapping? Thats
expensive...
We manually store timestamps for creation and last update of our indices
within the "_meta" tag of a mapping. Then we use "Get Mapping" to fetch
these timestamps.
An alternative is to use the new timestamps[1] of the documents in the
index and search on that field, maybe using the term_stats facet to obtain
the max...
On Thu, Dec 29, 2011 at 12:38, Ivan Brusic ivan@brusic.com wrote:
Mayer,
I do not think it is possible to get the date/time of the last time an
index was updated. Perhaps someone can prove otherwise. I would be a
bit tough in a distributed environment.
For info on the fields, you can use the mapping API:
Yes, we did consider adding timestamps to documents at the time, but it
seemed more appropriate to use the _meta tag since it's an index-level
property (in our case at least). Maybe the _meta tag could be made
accessible from outside the mapping: since it's not used by es, updating it
shouldn't have any impact; just a thought.
What would be the most efficient way to query the "latest" (maximum) value
when using a timestamp field on the documents?
Thanks,
Philippe
On Fri, Dec 30, 2011 at 11:15, Shay Banon kimchy@gmail.com wrote:
Well, expensive in the sense that it needs to be broadcasted to the
cluster and persisted (the whole metadata). Even without the timestamp
feature, you can add a timestamp to a document indexed, and find the latest
one, you don't need the timestamp to have that ability.
Yes, that's what we ended up with. At the time, the document timestamps
didn't exist. I wasn't aware that updating the mapping was expensive. Is
this the case even when it's not chagning at all (except under _meta)?
Philippe
On Fri, Dec 30, 2011 at 10:06, Shay Banon kimchy@gmail.com wrote:
Storing the last update in the _meta part of the mapping? So does that
mean that for each document indexed, you update the mapping? Thats
expensive...
We manually store timestamps for creation and last update of our
indices within the "_meta" tag of a mapping. Then we use "Get Mapping" to
fetch these timestamps.
An alternative is to use the new timestamps[1] of the documents in the
index and search on that field, maybe using the term_stats facet to obtain
the max...
On Thu, Dec 29, 2011 at 12:38, Ivan Brusic ivan@brusic.com wrote:
Mayer,
I do not think it is possible to get the date/time of the last time an
index was updated. Perhaps someone can prove otherwise. I would be a
bit tough in a distributed environment.
For info on the fields, you can use the mapping API:
It does not matter if _meta is extracted or not, it still needs to be
broadcasted and persisted. The best way to get the "latest" value is to
sort base on the time field and ask for a single hit.
Yes, we did consider adding timestamps to documents at the time, but it
seemed more appropriate to use the _meta tag since it's an index-level
property (in our case at least). Maybe the _meta tag could be made
accessible from outside the mapping: since it's not used by es, updating it
shouldn't have any impact; just a thought.
What would be the most efficient way to query the "latest" (maximum) value
when using a timestamp field on the documents?
Thanks,
Philippe
On Fri, Dec 30, 2011 at 11:15, Shay Banon kimchy@gmail.com wrote:
Well, expensive in the sense that it needs to be broadcasted to the
cluster and persisted (the whole metadata). Even without the timestamp
feature, you can add a timestamp to a document indexed, and find the latest
one, you don't need the timestamp to have that ability.
Yes, that's what we ended up with. At the time, the document timestamps
didn't exist. I wasn't aware that updating the mapping was expensive. Is
this the case even when it's not chagning at all (except under _meta)?
Philippe
On Fri, Dec 30, 2011 at 10:06, Shay Banon kimchy@gmail.com wrote:
Storing the last update in the _meta part of the mapping? So does that
mean that for each document indexed, you update the mapping? Thats
expensive...
We manually store timestamps for creation and last update of our
indices within the "_meta" tag of a mapping. Then we use "Get Mapping" to
fetch these timestamps.
An alternative is to use the new timestamps[1] of the documents in the
index and search on that field, maybe using the term_stats facet to obtain
the max...
On Thu, Dec 29, 2011 at 12:38, Ivan Brusic ivan@brusic.com wrote:
Mayer,
I do not think it is possible to get the date/time of the last time an
index was updated. Perhaps someone can prove otherwise. I would be a
bit tough in a distributed environment.
For info on the fields, you can use the mapping API:
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.