Elasticsearch version: 2.4.2 and 5.2.1
Description of the problem including expected versus actual behavior:
Currently, if I have a "token_count" field, based on an analyzer containing a stop filter, the indexed "token_count" field counts stop words.
It would be great to have an option to only count analysis result tokens.
Steps to reproduce:
- I have this index configuration :
{
"settings": {
"index": {
"analysis": {
"analyzer": {
"default": {
"tokenizer": "standard",
"filter": [
"standard",
"lowercase",
"stop_words"
]
}
},
"filter": {
"stop_words": {
"type": "stop",
"stopwords": [
"this", "is", "a"
]
}
}
}
}
},
"mappings": {
"properties": {
"mytext": {
"index": "analyzed",
"type": "string",
"analyzer": "default",
"fields": {
"length": {
"type": "token_count",
"analyzer": "default",
"store": "yes"
}
}
}
}
}
}
}
- I index this document :
{
"mytext": "this is a cat"
}
- I make this search query :
GET _search
{
"query": {
"query_string": {
"query": "mytext.length:1"
}
}
}
- It should return 1 result. But it actually returns 0 result.
Elasticsearch version: 2.4.2 and 5.2.1
Description of the problem including expected versus actual behavior:
Currently, if I have a "token_count" field, based on an analyzer containing a stop filter, the indexed "token_count" field counts stop words.
It would be great to have an option to only count analysis result tokens.
Steps to reproduce:
{ "settings": { "index": { "analysis": { "analyzer": { "default": { "tokenizer": "standard", "filter": [ "standard", "lowercase", "stop_words" ] } }, "filter": { "stop_words": { "type": "stop", "stopwords": [ "this", "is", "a" ] } } } } }, "mappings": { "properties": { "mytext": { "index": "analyzed", "type": "string", "analyzer": "default", "fields": { "length": { "type": "token_count", "analyzer": "default", "store": "yes" } } } } } } }{ "mytext": "this is a cat" }