Hi,
I am still working on my maintenance task mentioned
here: https://groups.google.com/forum/?fromgroups#!topic/elasticsearch/Yby4DQFgIRw
I additionally added a IndexingOperationListener that listens to the
preIndex action.
My question is: How can I manipulate the documents? There is an
index.docs() method. For instance, I fetch the first (and only) document,
add a field and then want it to be persisted, but unfortunately, the field
won't get set / or removed.
Example:
indexingService.addListener(new IndexingOperationListener() {
@Override
public Index preIndex(Engine.Index index) {
List docs = index.docs();
List finalDocs = new ArrayList();
for (Document d : docs) {
d.removeField("field1");
finalDocs.add(d);
}
index.docs().clear();
index.docs().addAll(finalDocs);
return index;
}
});
Anything I do wrong?
Thanks,
Jan
--
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.