I am working on a POC to replace Lucene implementation in our product with
ElasticSearch.
Was looking for a way in Elasticsearch to create an object and setting the
field's Indexing behavior (i.e, store, type, index_type) dynamically while
indexing a document.
I understand that that you can create a mapping per index defining the
behavior. Is there a way to achieve something similar to the way we do it
in lucene as shown below?
//create lucene document and add fields and their indexing attributes
Document doc = new Document();
Field field = new Field("name", "name1", Field.Store.YES,
Field.Index.NOT_ANALYZED);
doc.add(field);
field = new Field("address", "address", Field.Store.YES,
Field.Index.DO_NOT_INDEX);
doc.add(field);
I am working on a POC to replace Lucene implementation in our product with Elasticsearch.
Was looking for a way in Elasticsearch to create an object and setting the field's Indexing behavior (i.e, store, type, index_type) dynamically while indexing a document.
I understand that that you can create a mapping per index defining the behavior. Is there a way to achieve something similar to the way we do it in lucene as shown below?
//create lucene document and add fields and their indexing attributes
Document doc = new Document();
Field field = new Field("name", "name1", Field.Store.YES, Field.Index.NOT_ANALYZED);
doc.add(field);
field = new Field("address", "address", Field.Store.YES, Field.Index.DO_NOT_INDEX);
doc.add(field);
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.