Add/Remove fields to/from existing index

Hi Folks,
how can we add/remove a field from existing index.?

Regrads
Mohit Kumar Yadav
(MCA/BBA)
Assocaite Software Developer
Next Gen Invent Corporation, Noida
Email Id : mohit.kumar@ngiventures.com,mohit.kumar.ngi@gmail.com

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

You have to reindex all documents without the field.
But if you reindex using the same type, field will still appear in mapping (that's not really an issue IMHO).

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 25 juil. 2013 à 09:34, Mohit Kumar Yadav mohit.kumar.ngi@gmail.com a écrit :

Hi Folks,
how can we add/remove a field from existing index.?

Regrads
Mohit Kumar Yadav
(MCA/BBA)
Assocaite Software Developer
Next Gen Invent Corporation, Noida
Email Id : mohit.kumar@ngiventures.com,mohit.kumar.ngi@gmail.com

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi David Pilato,
thank you very much for yours guidance.. I will go through yours guidance.
here is another question related to update query.
I was going through the elasticsearch website an found update tutorial for elasticsearch. http://www.elasticsearch.org/guide/reference/api/update/
from there I picked a query to add a new field in document.

curl -XPOST 'localhost:9200/test/type1/1/_update' -d '{
"script" : "ctx._source.text = "some text""
}'

but when i am running this query, I am getting following error. can you help me in understanding why this error is comming.

{"error":"JsonParseException[Unexpected character ('s' (code 40)): was expecting
comma to separate OBJECT entries\n at [Source: [B@58c3af97; line: 1, column: 42 ]]","status":500}

once again thank you for helping.

I suppose that it's due because you did not escape " in "some text"

Try with 'some text' or with "some text"

--
David Pilato | Technical Advocate | Elasticsearch.com
@dadoonet | @elasticsearchfr | @scrutmydocs

Le 25 juil. 2013 à 11:59, "mohit.Kumar" mohit.kumar.ngi@gmail.com a écrit :

Hi David Pilato,
thank you very much for yours guidance.. I will go through yours guidance.
here is another question related to update query.
I was going through the elasticsearch website an found update tutorial for
elasticsearch. http://www.elasticsearch.org/guide/reference/api/update/
from there I picked a query to add a new field in document.

curl -XPOST 'localhost:9200/test/type1/1/_update' -d '{
"script" : "ctx._source.text = "some text""
}'

but when i am running this query, I am getting following error. can you help
me in understanding why this error is comming.

{"error":"JsonParseException[Unexpected character ('s' (code 40)): was
expecting
comma to separate OBJECT entries\n at [Source: [B@58c3af97; line: 1, column: 42 ]]","status":500}

once again thank you for helping.

--
View this message in context: http://elasticsearch-users.115913.n3.nabble.com/Add-Remove-fields-to-from-existing-index-tp4038627p4038633.html
Sent from the ElasticSearch Users mailing list archive at Nabble.com.

--
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 elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.