Skip to content

Instantly share code, notes, and snippets.

Created September 5, 2011 14:29
Show Gist options
  • Save anonymous/1195120 to your computer and use it in GitHub Desktop.
Save anonymous/1195120 to your computer and use it in GitHub Desktop.
curl -XDELETE localhost:9200/test_index?pretty;
{
"ok" : true,
"acknowledged" : true
}
curl -XPOST localhost:9200/test_index?pretty -d '{
"analysis": {
"analyzer": {
"my_analyzer": {
"type": "standard",
"stopwords": [ "something" ]
}
}
}
}';
{
"ok" : true,
"acknowledged" : true
}
curl -XGET 'localhost:9200/test_index/_analyze?analyzer=my_analyzer&pretty' -d '{"the times"}';
{
"tokens" : [ {
"token" : "the",
"start_offset" : 2,
"end_offset" : 5,
"type" : "<ALPHANUM>",
"position" : 1
}, {
"token" : "times",
"start_offset" : 6,
"end_offset" : 11,
"type" : "<ALPHANUM>",
"position" : 2
} ]
}
---- now with no analyzer
curl -XDELETE localhost:9200/test_index?pretty;
{
"ok" : true,
"acknowledged" : true
}
curl -XPOST localhost:9200/test_index?pretty -d '{
"analysis": {
"analyzer": {
"my_analyzer": {
"type": "standard",
"stopwords": [ ]
}
}
}
}';
{
"ok" : true,
"acknowledged" : true
}
curl -XGET 'localhost:9200/test_index/_analyze?analyzer=my_analyzer&pretty' -d '{"the times"}';
{
"tokens" : [ {
"token" : "times",
"start_offset" : 6,
"end_offset" : 11,
"type" : "<ALPHANUM>",
"position" : 2
} ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment