Elasticsearch: How to ignore a filed in elastic search mapping

Created on 11 Sep 2015  ·  3Comments  ·  Source: elastic/elasticsearch

Hello,

In my data, i want to ignore a field. How should i create a mapping for this? For example,

{
"key1":"value1",

"key2":"value2"
}

i want to ignore key2, so how should i create my mapping?

thanks

Most helpful comment

It depends on what you mean by "ignore," but your question will likely be answered on the core types reference docs. For example:

  • You can add "store":false to the key2 mapping to not store it in the index
  • You can add "include_in_all":false to the key2 mapping to make it not included in the _all field (which means it won't be included in a text search unless you search explicitly on the key2 field)
  • You can set "index":"no" to the key2 mapping to make it not searchable at all

FYI, we have a great discussion forum where questions like these can be asked!

All 3 comments

It depends on what you mean by "ignore," but your question will likely be answered on the core types reference docs. For example:

  • You can add "store":false to the key2 mapping to not store it in the index
  • You can add "include_in_all":false to the key2 mapping to make it not included in the _all field (which means it won't be included in a text search unless you search explicitly on the key2 field)
  • You can set "index":"no" to the key2 mapping to make it not searchable at all

FYI, we have a great discussion forum where questions like these can be asked!

thanks, i tried to include everything like
"key2":{
"type" : "object",
"enabled" : false,
"store":false,
"include_in_all":false,
"index":"no"
}

but still, when i try to ingest the data,, it is not ignored. i will post the question on the forum as well.

thanks

Discussion continued here for anybody that wants to track this. It looks like a relatively simple misconfiguration at this time

Was this page helpful?
0 / 5 - 0 ratings