The Analyze of elasticsearch (analytical process)

Source: Internet
Author: User
Tags ming
_analyze is a very useful Elasticsearch API that can help you analyze how each field or a analyzer/tokenizer analyzes and indexes a text.
Returns the result field meaning: token is a word that is actually stored in the index position indicates the number of occurrences of the Start_offset and End_offset in the original text, where the word occupies the original text.
1, the default analyzer get/_analyze?
{"Analyzer": "Standard",   "text": "Bed before the Moon Light"} {  "tokens": [    {      "token": "Bed",       "Start_offset": 0,   &NB Sp   "End_offset": 1,       "type": "<IDEOGRAPHIC>",       "position": 0   &nbs P },     {      "token": "Pre",       "Start_offset": 1,       "end_of" Fset ": 2,      " type ":" <IDEOGRAPHIC> ",      " position ": 1    },   & nbsp {      "token": "Ming",       "Start_offset": 2,       "End_offset": 3,       "type": "<IDEOGRAPHIC>"       "position": 2    },     {  &NBsp   "token": "Month",       "Start_offset": 3,       "End_offset": 4,       "T Ype ": <IDEOGRAPHIC>"       "position": 3    },     {      Tok En ": Light"       "Start_offset": 4,       "End_offset": 5,       "type": "< Ideographic> ",      " position ": 4    }  } 2, you can also use the specified analyzer to analyze using Whitspace get/_anal
Yze?


{  "analyzer": "Whitespace",   "text": "Bright Moonlight Before Bed"} {  "tokens": [    {      "token": "Pre-bed",       "Start_offset": 0,   &N Bsp   "End_offset": 2,       "type": "word",       "position": 0    },   &N Bsp {      "token": "Moon Light",       "Start_offset": 3,       "End_offset": 6, &NBSP ;     "type": "word",       "PositioN ": 1    }  } 3, using IK Analyzer get/tystock/_analyze?
{  "Analyzer": "Ik_max_word",   "text": "Bright Moonlight Before Bed"}  {  "tokens": [    {      "token": "The bright Moonlight before the bed",       "Start_offset": 0,       "End_offset": 5,       "type": "Cn_word",       "position": 0    } ,     {      "token": "Bed before",       "Start_offset": 0,       "end_of" Fset ": 2      " type ":" Cn_word ",      " position ": 1    },     {&nbs P     "token": "Moon Light",       "Start_offset": 2,       "End_offset": 5,       "type": "Cn_word"       "position": 2    },     {      "token" : "Moon",       "Start_offset": 2,       "End_offset": 4,       "type": "Cn_wor D ",   &NBSP   "position": 3    },     {      "token": "Ming",       "START_OFFSE" T ": 2,      " End_offset ": 3,      " type ":" Cn_word ",      " position ": 4 &N Bsp   },     {      "token": "Moonlight",       "Start_offset": 3,       "End_offset": 5       "type": "Cn_word",       "position": 5    },   &NBSP ; {      "token": "Month",       "Start_offset": 3,       "End_offset": 4,       "type": "Cn_word",       "position": 6    },     {      "token": "Light"       "Start_offset": 4,       "End_offset": 5,       "type": "
Cn_char ",      " position ": 7    }  ] 4, using phonetic Analyzer Get/tystock/_analyze?
{  "analyzer": "Pinyin",  "text": "Bed before the Moon Light"} {  "tokens": [    {      "token": "Chuang",     &NBSP ; "Start_offset": 0,       "End_offset": 1,       "type": "word",       Positi On ": 0    },     {     " token ":" Cqmyg ",      " Start_offset ": 0, &NB Sp     "End_offset": 5,       "type": "word",       "position": 0    }, &N Bsp   {      "token": "Qian",       "Start_offset": 1,       "End_offset": 2,       "type": "word",       "position": 1    },     {       "token": "Ming",       "Start_offset": 2,       "End_offset": 3,      
"Type": "word"       "position": 2    },     {      "token": "Yue",       "Start_offset": 3,       "End_offset": 4,       "type": "word",       "Position": 3    },     {      "token": "Guang",       "Start_offset" : 4,       "End_offset": 5,       "type": "word",       "position": 4  
  }  ]}
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.