[Question] Field Mapping while indexing


(Srividhya Umashanker) #1

All -

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);

writer.updateDocument(term, doc);


-Vidhya

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/79a5f1c0-d783-4aea-aa42-6462c737b8d7%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(David Pilato) #2

My bet is that you are looking for templates or so?

Not sure I fully understood the use case though.

--
David :wink:
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 7 févr. 2014 à 10:20, Srividhya Umashanker srividhya.umashanker@gmail.com a écrit :

All -

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);

writer.updateDocument(term, doc);


-Vidhya

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/79a5f1c0-d783-4aea-aa42-6462c737b8d7%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/849FD880-7CC0-4033-811A-E0522DA5D53A%40pilato.fr.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #3