Skip to content

Instantly share code, notes, and snippets.

@radu-gheorghe
Created July 10, 2013 08:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save radu-gheorghe/5964537 to your computer and use it in GitHub Desktop.
Save radu-gheorghe/5964537 to your computer and use it in GitHub Desktop.
index and search for a value containing #
curl -XDELETE localhost:9200/test1
curl -XPUT localhost:9200/test1
curl -XPUT localhost:9200/test1/test/_mapping -d '{
"test": {
"properties": {
"foo": {
"type": "string",
"index": "not_analyzed"
}
}
}
}'
curl -XPOST localhost:9200/test1/test/ -d '{ "foo": "#bar"}'
curl -XPOST localhost:9200/test1/_refresh
sleep 1
curl localhost:9200/test1/test/_search -d '{
"query": {
"term": {
"foo": "#bar"
}
}
}'
@LarryBattleWork
Copy link

As of ElasticSearch version 1.3.x+

curl -XPUT localhost:9200/test1/test/_mapping -d '{

should be

curl -XPUT localhost:9200/test1/_mapping/test/ -d '{

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment