LoginSignup
3
3

More than 5 years have passed since last update.

ElasticsearchでJSONのデータをパースしてほしくないとき

Last updated at Posted at 2016-02-24

(昔書いたメモが見つかったのでupする)
ElasticsearchはドキュメントにJSONデータがあると自動的にパースした上でIndexを作ってくれます。
でも、パースせずにそのままIndexにしたいときは以下のようにします。

mappingsのtypeをobjectにして、enabledをfalseに。

{

//...省略

"name" : {
  "type" : "object",
  "enabled" : false
}

//...省略

railsを使っていてelasticsearch-modelを使っている場合はこんな感じ

indexes :name, type: 'object', enabled: false

Elasticsearch公式のドキュメントはこちら

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3