0

I'm using Elasticsearch 1.1.1, River Plugin and MongoDB 2.4

I have a field called cidr that is being analyzed. I need to set it so that it is not_analyzed anymore to use it with Kibana correctly. Following is the index I used. But now Im going to reindex it again (delete and write a new one.)

Whats the proper way to write a new index in a way that the values in the "cidr" field are not analyzed? Thank you.

curl -XPUT 'http://localhost:9200/_river/mongodb/_meta' -d '{
    "type": "mongodb", 
    "mongodb": { 
        "db": "collective_name",
        "collection": "ips"
    }, 
    "index": { 
        "name": "mongoindex"
    }
}'
hello_its_me
  • 743
  • 2
  • 19
  • 52

1 Answers1

0

I see. It's working now. Mapping should be created BEFORE creating the index.

curl -XPUT "localhost:9200/mongoindex" -d '
{
    "mappings": {
       "mongodb" : {
        "properties": {
            "cidr": {"type":"string", "index" : "not_analyzed"}
        }
      }
    }
}'

This is it. :)

hello_its_me
  • 743
  • 2
  • 19
  • 52