lets say when i create a document, i have fields "a", "b" and "c"'. later i
want to retrieve the document(s) and completely clear off fields "b" and
"c". is it possible to do so?
or do i need to delete the document and create a new one with the same id
and just 1 field - "a"?
It is not possible to delete fields from a document in the index. You
would need to reindex the document, which is standard in Lucene. The
latest version of ES has the capability to update a field based on a
script (which reindexes behind the scenes), but not delete a field.
You can always return only the relevant fields from a search by
requesting only the fields you want.
lets say when i create a document, i have fields "a", "b" and "c"'. later i
want to retrieve the document(s) and completely clear off fields "b" and
"c". is it possible to do so?
or do i need to delete the document and create a new one with the same id
and just 1 field - "a"?
You can simply get the document, clear the fields, and index it again. You can use versioning to make sure no updates has happening while you were getting the document and updating the data.
0.19 has an update API that can be used remove the need of roundtrip of getting the doc and updating it.
On Friday, February 17, 2012 at 11:48 PM, Ivan Brusic wrote:
It is not possible to delete fields from a document in the index. You
would need to reindex the document, which is standard in Lucene. The
latest version of ES has the capability to update a field based on a
script (which reindexes behind the scenes), but not delete a field.
You can always return only the relevant fields from a search by
requesting only the fields you want.
lets say when i create a document, i have fields "a", "b" and "c"'. later i
want to retrieve the document(s) and completely clear off fields "b" and
"c". is it possible to do so?
or do i need to delete the document and create a new one with the same id
and just 1 field - "a"?
On Sun, Feb 19, 2012 at 4:50 AM, Shay Banon kimchy@gmail.com wrote:
You can simply get the document, clear the fields, and index it again.
You can use versioning to make sure no updates has happening while you were
getting the document and updating the data.
0.19 has an update API that can be used remove the need of roundtrip of
getting the doc and updating it.
On Friday, February 17, 2012 at 11:48 PM, Ivan Brusic wrote:
It is not possible to delete fields from a document in the index. You
would need to reindex the document, which is standard in Lucene. The
latest version of ES has the capability to update a field based on a
script (which reindexes behind the scenes), but not delete a field.
You can always return only the relevant fields from a search by
requesting only the fields you want.
lets say when i create a document, i have fields "a", "b" and "c"'. later i
want to retrieve the document(s) and completely clear off fields "b" and
"c". is it possible to do so?
or do i need to delete the document and create a new one with the same id
and just 1 field - "a"?
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.