Parse the text using the API
It is useful to use the analysis API to test the analysis process when tracking how information is stored in the Elasticsearch index. This API allows you to send any text to Elasticsearch, specify the parser, word splitter, or word filter to be used, and get the parsed word segmentation.
Global analyzer
POST /_analyze {"analyzer":"ik_smart", "text":" This is title4"} {"tokens" : [{"token" :" this is ", "start_offset" : 0, "end_offset" : 2, "type" : "CN_WORD", "position" : 0 }, { "token" : "title4", "start_offset" : 2, "end_offset" : 8, "type" : "LETTER", "position" : 1 } ] }Copy the code
Parsers in indexes
POST /get-together/_analyze
{
"analyzer": "myCustomAnalyzer",
"text":"share your experience with NoSql"
}
Copy the code
Self combination analyzer
POST /_analyze
{
"char_filter": ["html_strip"],
"tokenizer": "whitespace",
"filter": ["lowercase"],
"text": "SHARE <b>your</b> experience with NoSql"
}
Copy the code
Analysis based on a field map
# users bobby is ik_max_word POST /users/_analyze {"field": "hobby", "text": "Hello, everyone"}Copy the code