-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Labels
:Search Relevance/AnalysisHow text is split into tokensHow text is split into tokensTeam:Search RelevanceMeta label for the Search Relevance team in ElasticsearchMeta label for the Search Relevance team in Elasticsearchdiscuss
Description
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.
Metadata
Metadata
Assignees
Labels
:Search Relevance/AnalysisHow text is split into tokensHow text is split into tokensTeam:Search RelevanceMeta label for the Search Relevance team in ElasticsearchMeta label for the Search Relevance team in Elasticsearchdiscuss