Skip to content

Instantly share code, notes, and snippets.

@keteracel
Created May 8, 2011 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keteracel/961537 to your computer and use it in GitHub Desktop.
Save keteracel/961537 to your computer and use it in GitHub Desktop.
Mappings don't seem to work as expected
curl -XPUT 'http://127.0.0.1:9200/i1/?pretty=1' -d '
{
"settings" : {
"analysis" : {
"filter" : {
"edge_ngram" : {
"side" : "front",
"max_gram" : 20,
"min_gram" : 1,
"type" : "edgeNGram"
}
},
"analyzer" : {
"ascii_ngram" : {
"filter" : [
"standard",
"lowercase",
"asciifolding",
"nGram"
],
"type" : "custom",
"tokenizer" : "standard"
},
"ascii_std" : {
"filter" : [
"standard",
"lowercase",
"asciifolding"
],
"type" : "custom",
"tokenizer" : "standard"
},
"ascii_edge_ngram" : {
"filter" : [
"standard",
"lowercase",
"asciifolding",
"edge_ngram"
],
"type" : "custom",
"tokenizer" : "standard"
}
}
}
}
}
'
curl -XPUT 'http://127.0.0.1:9200/i1/website/_mapping?pretty=1' -d '
{
"website" : {
"properties" : {
"uri" : {
"type" : "string",
"include_in_all" : 0,
"index_analyzer" : "ascii_ngram",
"search_analyzer" : "ascii_std"
}
}
}
}
'
curl -XPOST 'http://127.0.0.1:9200/i1/website?pretty=1' -d '
{
"uri" : "http://www.heise.de"
}
'
curl -XPOST 'http://127.0.0.1:9200/i1/_refresh'
curl -XGET 'http://127.0.0.1:9200/i1/website/_search?pretty=1' -d '
{
"query" : {
"field" : {
"uri" : "heis"
}
}
}
'
curl -XPUT 'http://127.0.0.1:9200/i1/website2/_mapping?pretty=1' -d '
{
"website" : {
"properties" : {
"uri" : {
"type" : "string",
"include_in_all" : 0,
"index_analyzer" : "ascii_ngram",
"search_analyzer" : "ascii_ngram"
}
}
}
}
'
curl -XPOST 'http://127.0.0.1:9200/i1/website2?pretty=1' -d '
{
"uri" : "http://www.heise.de"
}
'
curl -XPOST 'http://127.0.0.1:9200/i1/_refresh'
curl -XGET 'http://127.0.0.1:9200/i1/website2/_search?pretty=1' -d '
{
"query" : {
"field" : {
"uri" : "heis"
}
}
}
'
curl -XPUT 'http://127.0.0.1:9200/i3/?pretty=1' -d '
{
"settings" : {
"analysis" : {
"filter" : {
"edge_ngram" : {
"side" : "front",
"max_gram" : 20,
"min_gram" : 1,
"type" : "edgeNGram"
}
},
"analyzer" : {
"ascii_ngram" : {
"filter" : [
"standard",
"lowercase",
"asciifolding",
"nGram"
],
"type" : "custom",
"tokenizer" : "standard"
},
"ascii_std" : {
"filter" : [
"standard",
"lowercase",
"asciifolding"
],
"type" : "custom",
"tokenizer" : "standard"
},
"ascii_edge_ngram" : {
"filter" : [
"standard",
"lowercase",
"asciifolding",
"edge_ngram"
],
"type" : "custom",
"tokenizer" : "standard"
}
}
}
}
}
'
curl -XPUT 'http://127.0.0.1:9200/i3/website/_mapping?pretty=1' -d '
{
"website" : {
"properties" : {
"uri" : {
"type" : "string",
"include_in_all" : 0,
"index_analyzer" : "ascii_ngram",
"search_analyzer" : "ascii_ngram"
}
}
}
}
'
curl -XPOST 'http://127.0.0.1:9200/i3/website?pretty=1' -d '
{
"uri" : "http://www.heise.de"
}
'
curl -XPOST 'http://127.0.0.1:9200/i3/_refresh'
curl -XGET 'http://127.0.0.1:9200/i3/website/_search?pretty=1' -d '
{
"query" : {
"field" : {
"uri" : "heis"
}
}
}
'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment