Search for parentheses via ElasticSearch -


i have requirement need index text prefixed (std) should able search again.

ie. document (html) contains following sentence

(std)almindelige betingelser misligholdelseserstatning

and should able query

(std)almindelige betingelser

now, i've read whole lot in documentations , have charfilter in place replaces ( , ) _, , thought safe replace in search-query well, becomes

_std_almindelige betingelser

but reason not working @ all. no result @ being returned when searching _std_almindelige betingelser though can see term there browsing document , return list of facets.

this index settings , type mapping

var settings = new indexsettings();  settings.analysis.charfilters.add("parenthesis", new mappingcharfilter {     mappings = new[] { "( => _", ") => _" } });  settings.analysis.tokenfilters.add("snowball", new snowballtokenfilter {     language = "danish" });  settings.analysis.analyzers.add("content", new customanalyzer {     charfilter = new list<string>() { "html_strip", "parenthesis" },     tokenizer = "whitespace",     filter = new list<string>() { "lowercase", "snowball" } }); 

and mapping

{"searchservicepages":{     "_source":{         "excludes" : ["content"]     },     "properties":{         "content":{             "type":"string",             "index_analyzer"":"content"         }     } }} 

the problem in mapping. should change "index_analyzer": "content" "analyzer":"your_analyzer_name"

while mapping giving me trouble, same index settings following mapping worked fine.

  "testindex": {         "testdoc": {           "_source": {             "excludes": [               "content"             ]           },           "properties": {             "content": {               "type": "string",               "analyzer": "myanalyzer"             }           }         } 

btw i'm using es 0.90.2


Comments