Set custom settings for a index

Hi
I have two index, one I use default analyze, other I want set a custom
analyze to it.

I set up as bellow in config file:

index:
analysis:
tokenizer:
my_gram:
type: edgeNGram
min_gram: 1
max_gram: 50
analyzer:
default:
tokenizer: whitespace
filter: [lowercase]
auto:
type: custom
tokenizer: my_gram
filter: [asciifolding,lowercase]
mappings:

  • my_custom_index: *
  •  song_name:          *
    
  •    analyzer: auto*
    
  •    index_analyzer: auto*
    
  •    search_analyzer: auto*
    

I have tried to change many kinds of mapping but it dont apply "auto"
analyze to "my_custom_index" or "song_name" type of "my_custom_index".
ex:
mappings:

  • my_custom_index: *
  •    analyzer: auto*
    

....

--

any help ?

On Friday, November 23, 2012 9:28:48 AM UTC+7, kidkid wrote:

Hi
I have two index, one I use default analyze, other I want set a custom
analyze to it.

I set up as bellow in config file:

index:
analysis:
tokenizer:
my_gram:
type: edgeNGram
min_gram: 1
max_gram: 50
analyzer:
default:
tokenizer: whitespace
filter: [lowercase]
auto:
type: custom
tokenizer: my_gram
filter: [asciifolding,lowercase]
mappings:

  • my_custom_index: *
  •  song_name:          *
    
  •    analyzer: auto*
    
  •    index_analyzer: auto*
    
  •    search_analyzer: auto*
    

I have tried to change many kinds of mapping but it dont apply "auto"
analyze to "my_custom_index" or "song_name" type of "my_custom_index".
ex:
mappings:

  • my_custom_index: *
  •    analyzer: auto*
    

....

--

You can specify both the analyzer and mappings when you create the second
index using Index Create API:

curl -XPUT localhost:9200/my_custom_index -d '{
"settings": {
"index": {
"analysis": {
"tokenizer": {
"my_gram": {
"type": "edgeNGram",
"min_gram": 1,
"max_gram": 50
}
},
"analyzer": {
"default": {
"tokenizer": "whitespace",
"filter": ["lowercase"]
},
"auto": {
"type": "custom",
"tokenizer": "my_gram",
"filter": ["asciifolding", "lowercase"]
}
}
}
}
},
"mappings": {
"my_type": {
"properties": {
"song_name": {
"type": "string",
"analyzer": "auto"
}
}
}
}
}'

Alternatively, you can store your mapping in a file and put in
config/mappings/[index_name]
directory Elasticsearch Platform — Find real-time answers at scale | Elastic

On Friday, November 23, 2012 6:54:25 AM UTC-5, kidkid wrote:

any help ?

On Friday, November 23, 2012 9:28:48 AM UTC+7, kidkid wrote:

Hi
I have two index, one I use default analyze, other I want set a custom
analyze to it.

I set up as bellow in config file:

index:
analysis:
tokenizer:
my_gram:
type: edgeNGram
min_gram: 1
max_gram: 50
analyzer:
default:
tokenizer: whitespace
filter: [lowercase]
auto:
type: custom
tokenizer: my_gram
filter: [asciifolding,lowercase]
mappings:

  • my_custom_index: *
  •  song_name:          *
    
  •    analyzer: auto*
    
  •    index_analyzer: auto*
    
  •    search_analyzer: auto*
    

I have tried to change many kinds of mapping but it dont apply "auto"
analyze to "my_custom_index" or "song_name" type of "my_custom_index".
ex:
mappings:

  • my_custom_index: *
  •    analyzer: auto*
    

....

--