-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Closed
Closed
Copy link
Labels
:Search Relevance/AnalysisHow text is split into tokensHow text is split into tokens:Search Relevance/RankingScoring, rescoring, rank evaluation.Scoring, rescoring, rank evaluation.Team:Search RelevanceMeta label for the Search Relevance team in ElasticsearchMeta label for the Search Relevance team in Elasticsearch
Description
Description
Hi,
On the Romanian analyzer, using a wildcard for a stop word in a simple_query_string generates a MatchNoDocsQuery, which prevents matching any documents. The expected behavior is to remove the stop word from the query instead of generating a MatchNoDocsQuery. This behavior seems similar to issue #1272.
Environment
{
"name" : "7f11a5b18353",
"cluster_name" : "docker-cluster",
"cluster_uuid" : "_XRGD9iLQP6BSlAcqjVV0A",
"version" : {
"number" : "8.1.3",
"build_flavor" : "default",
"build_type" : "docker",
"build_hash" : "39afaa3c0fe7db4869a161985e240bd7182d7a07",
"build_date" : "2022-04-19T08:13:25.444693396Z",
"build_snapshot" : false,
"lucene_version" : "9.0.0",
"minimum_wire_compatibility_version" : "7.17.0",
"minimum_index_compatibility_version" : "7.0.0"
},
"tagline" : "You Know, for Search"
}
Steps to Reproduce:
-
Create an index with the Romanian analyzer:
PUT test_index { "settings": { "index": { "refresh_interval": "1s", "number_of_shards": "1", "analysis": { "analyzer": { "default": { "type": "romanian" } } }, "number_of_replicas": "0" } }, "mappings": { "properties": { "text": { "type": "text" } } } } -
Index a document containing the stopword "Pentru":
PUT test_index/_doc/1 { "text": "Textile Pentru Casă" } -
Search using
simple_query_stringwith a wildcard:GET test_index/_search { "profile": true, "query": { "simple_query_string": { "query": "(Textile*+Pentru*+Casă*)", "fields": ["text"], "analyze_wildcard": true } } }
Observed Behavior
The search result returns no matches, and the query generates a MatchNoDocsQuery. The profile output shows:
{
"type": "MatchNoDocsQuery",
"description": "MatchNoDocsQuery('empty BooleanQuery')"
}
Expected Behavior
The stop word should be removed from the query, and the document should match as expected.
erayarslan, ramazanefegurkan and mertbahardogan
Metadata
Metadata
Assignees
Labels
:Search Relevance/AnalysisHow text is split into tokensHow text is split into tokens:Search Relevance/RankingScoring, rescoring, rank evaluation.Scoring, rescoring, rank evaluation.Team:Search RelevanceMeta label for the Search Relevance team in ElasticsearchMeta label for the Search Relevance team in Elasticsearch