Created
April 20, 2017 21:52
-
-
Save mschoch/9dad311c89647d5bb4bb39049a43a7fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
err = indexMapping.AddCustomTokenMap("myStopWords", map[string]interface{}{ | |
"tokens": []interface{}{"a", "in", "the"}, | |
}) | |
if err != nil { | |
return nil, err | |
} | |
err = indexMapping.AddCustomTokenFilter("myStopFilter", map[string]interface{}{ | |
"type": "stop_tokens", | |
"stop_token_map": "stop_test", | |
}) | |
if err != nil { | |
return nil, err | |
} | |
err = indexMapping.AddCustomAnalyzer("myCustomAnalyzerWithStop", | |
map[string]interface{}{ | |
"type": custom.Name, | |
"tokenizer": unicode.Name, | |
"token_filters": []string{ | |
lowercase.Name, | |
"myStopFilter", | |
}, | |
}) | |
if err != nil { | |
return nil, err | |
} | |
indexMapping.DefaultAnalyzer = "myCustomAnalyzerWithStop" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment