2013-08-28 19:24:34 -04:00
|
|
|
[[analysis-keyword-analyzer]]
|
|
|
|
=== Keyword Analyzer
|
|
|
|
|
2016-05-11 08:17:56 -04:00
|
|
|
The `keyword` analyzer is a ``noop'' analyzer which returns the entire input
|
|
|
|
string as a single token.
|
|
|
|
|
|
|
|
[float]
|
|
|
|
=== Definition
|
|
|
|
|
|
|
|
It consists of:
|
|
|
|
|
|
|
|
Tokenizer::
|
|
|
|
* <<analysis-keyword-tokenizer,Keyword Tokenizer>>
|
|
|
|
|
|
|
|
[float]
|
|
|
|
=== Example output
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
---------------------------
|
|
|
|
POST _analyze
|
|
|
|
{
|
|
|
|
"analyzer": "keyword",
|
|
|
|
"text": "The 2 QUICK Brown-Foxes jumped over the lazy dog's bone."
|
|
|
|
}
|
|
|
|
---------------------------
|
|
|
|
// CONSOLE
|
|
|
|
|
2016-05-19 13:42:23 -04:00
|
|
|
/////////////////////
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
----------------------------
|
|
|
|
{
|
|
|
|
"tokens": [
|
|
|
|
{
|
|
|
|
"token": "The 2 QUICK Brown-Foxes jumped over the lazy dog's bone.",
|
|
|
|
"start_offset": 0,
|
|
|
|
"end_offset": 56,
|
|
|
|
"type": "word",
|
|
|
|
"position": 0
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
----------------------------
|
|
|
|
// TESTRESPONSE
|
|
|
|
|
|
|
|
/////////////////////
|
|
|
|
|
|
|
|
|
2016-05-11 08:17:56 -04:00
|
|
|
The above sentence would produce the following single term:
|
|
|
|
|
|
|
|
[source,text]
|
|
|
|
---------------------------
|
|
|
|
[ The 2 QUICK Brown-Foxes jumped over the lazy dog's bone. ]
|
|
|
|
---------------------------
|
|
|
|
|
|
|
|
[float]
|
|
|
|
=== Configuration
|
|
|
|
|
|
|
|
The `keyword` analyzer is not configurable.
|