Hi guys,
The documents I want to index contains multiple fields, such as doc_id,
doc_content and doc_time.
I just want to create index in doc_content field. What should I do when put
mapping for these three fields.
For the other two fields I don't want to index, should I set "index" as
"no" or "not_analyzed" ?
By the way, I want to get doc_id and doc_time after I conduct a query on
doc_content, so I keep the two fields in the mapping.
XContentBuilder mapping = jsonBuilder()
.startObject()
.startObject("myType")
.startObject("properties")
.startObject("doc_id").field("type",
"string").field("index","not_analyzed").endObject()
.startObject("doc_content").field("type",
"string").field("index", "not_analyzed").endObject()
.startObject("doc_time").field("type","string").field("index","not_analyzed").endObject()
.endObject()
.endObject()
.endObject();
PutMappingRequest mappingRequest =
Requests.putMappingRequest("Myindex").type("myType").source(mapping);
I used above mapping settings, the index created for 8M data is ~37M. Is it
a normal phenomenon?
Any help would be appreciated.
--
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.