| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 | [[analysis-keyword-analyzer]]=== Keyword analyzer++++<titleabbrev>Keyword</titleabbrev>++++The `keyword` analyzer is a ``noop'' analyzer which returns the entire inputstring as a single token.[discrete]=== Example output[source,console]---------------------------POST _analyze{  "analyzer": "keyword",  "text": "The 2 QUICK Brown-Foxes jumped over the lazy dog's bone."}---------------------------/////////////////////[source,console-result]----------------------------{  "tokens": [    {      "token": "The 2 QUICK Brown-Foxes jumped over the lazy dog's bone.",      "start_offset": 0,      "end_offset": 56,      "type": "word",      "position": 0    }  ]}----------------------------/////////////////////The above sentence would produce the following single term:[source,text]---------------------------[ The 2 QUICK Brown-Foxes jumped over the lazy dog's bone. ]---------------------------[discrete]=== ConfigurationThe `keyword` analyzer is not configurable.[discrete]=== DefinitionThe `keyword` analyzer consists of:Tokenizer::* <<analysis-keyword-tokenizer,Keyword Tokenizer>>If you need to customize the `keyword` analyzer then you need torecreate it as a `custom` analyzer and modify it, usually by addingtoken filters. Usually, you should prefer the<<keyword, Keyword type>> when you want strings that are not splitinto tokens, but just in case you need it, this would recreate thebuilt-in `keyword` analyzer and you can use it as a starting pointfor further customization:[source,console]----------------------------------------------------PUT /keyword_example{  "settings": {    "analysis": {      "analyzer": {        "rebuilt_keyword": {          "tokenizer": "keyword",          "filter": [         <1>          ]        }      }    }  }}----------------------------------------------------// TEST[s/\n$/\nstartyaml\n  - compare_analyzers: {index: keyword_example, first: keyword, second: rebuilt_keyword}\nendyaml\n/]<1> You'd add any token filters here.
 |