How to defines both the index_analyzer and search_analyzer explicitly?


(shammi mishra) #1

Hi

I want to define both the index_analyzer and search_analyzer
explicitly using mapping. i have read following documents

Index / Search Analyzers
http://www.elasticsearch.org/guide/reference/mapping/root-object-type.html

Analyzer
http://www.elasticsearch.org/guide/reference/index-modules/analysis/

Core Types
http://www.elasticsearch.org/guide/reference/mapping/core-types.html

for reading this document,i am confuse for explicitly defining both.
after some Google i found following link :

after that i have try following mapping:

{
"settings":{
"analysis": {
"analyzer":
{
"index_analyzer": {
"name":"default",
"type" :"custom",
"tokenizer": "whitespace",
"filter": ["lowercase", "customstopfilter", "asciifolding"]
},
"search_analyzer": {
"name":"default",
"type" :"custom",
"tokenizer": "whitespace" ,
"filter": ["lowercase", "customstopfilter", "asciifolding"]
}
},
{
"filter":{
"customstopfilter":
{
"type":"stop" ,
"stopwords_path" :"F:\resources\stopwords_eng.txt" ,
"ignore_case":true
}
}
}
}
}
}

but again i failed to configured it,please help me.

Thanks


(Karussell) #2

try to search the mailing list before :slight_smile:

http://groups.google.com/group/elasticsearch/browse_thread/thread/2c3082a47d10ba41/328970161fdc66a0?lnk=gst&q=custom+analyzer#328970161fdc66a0

Peter.

On 18 Jan., 10:10, shammi mishra mishrashamm...@gmail.com wrote:

Hi

I want to define both the index_analyzer and search_analyzer
explicitly using mapping. i have read following documents

Index / Search Analyzershttp://www.elasticsearch.org/guide/reference/mapping/root-object-type...

Analyzerhttp://www.elasticsearch.org/guide/reference/index-modules/analysis/

Core Typeshttp://www.elasticsearch.org/guide/reference/mapping/core-types.html

for reading this document,i am confuse for explicitly defining both.
after some Google i found following link :https://gist.github.com/1109136

after that i have try following mapping:

{
"settings":{
"analysis": {
"analyzer":
{
"index_analyzer": {
"name":"default",
"type" :"custom",
"tokenizer": "whitespace",
"filter": ["lowercase", "customstopfilter", "asciifolding"]
},
"search_analyzer": {
"name":"default",
"type" :"custom",
"tokenizer": "whitespace" ,
"filter": ["lowercase", "customstopfilter", "asciifolding"]
}
},
{
"filter":{
"customstopfilter":
{
"type":"stop" ,
"stopwords_path" :"F:\resources\stopwords_eng.txt" ,
"ignore_case":true
}
}
}
}
}

}

but again i failed to configured it,please help me.

Thanks


(Karussell) #3

I mean use java api or elasticsearch.yml/json like here:

On 18 Jan., 14:11, Karussell tableyourt...@googlemail.com wrote:

try to search the mailing list before :slight_smile:

http://groups.google.com/group/elasticsearch/browse_thread/thread/2c3...

Peter.

On 18 Jan., 10:10, shammi mishra mishrashamm...@gmail.com wrote:

Hi

I want to define both the index_analyzer and search_analyzer
explicitly using mapping. i have read following documents

Index / Search Analyzershttp://www.elasticsearch.org/guide/reference/mapping/root-object-type...

Analyzerhttp://www.elasticsearch.org/guide/reference/index-modules/analysis/

Core Typeshttp://www.elasticsearch.org/guide/reference/mapping/core-types.html

for reading this document,i am confuse for explicitly defining both.
after some Google i found following link :https://gist.github.com/1109136

after that i have try following mapping:

{
"settings":{
"analysis": {
"analyzer":
{
"index_analyzer": {
"name":"default",
"type" :"custom",
"tokenizer": "whitespace",
"filter": ["lowercase", "customstopfilter", "asciifolding"]
},
"search_analyzer": {
"name":"default",
"type" :"custom",
"tokenizer": "whitespace" ,
"filter": ["lowercase", "customstopfilter", "asciifolding"]
}
},
{
"filter":{
"customstopfilter":
{
"type":"stop" ,
"stopwords_path" :"F:\resources\stopwords_eng.txt" ,
"ignore_case":true
}
}
}
}
}

}

but again i failed to configured it,please help me.

Thanks


(system) #4