for example I have following documents
{
term: "bo"
},
{
term: "book"
}
I want to delete all documents that "term" field length is less than 3
for example I have following documents
{
term: "bo"
},
{
term: "book"
}
I want to delete all documents that "term" field length is less than 3
A few approaches I can think of are:
*Highly recommended that you query first and confirm that the results of your query yield the desired hits.
Utilize delete_by_query API in combination with a script query.
Reindex your data such that the field you're interested in becomes a multi-field, using a token_count with appropriate analyzer for your data. Then delete by query using the token_count field directly with no script.
Reindex using an ingest pipeline with drop processor that filters out docs where the field of interest is less than 3 chars long.
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
© 2020. All Rights Reserved - Elasticsearch
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.