mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 23:27:25 -04:00
Add rule retriever yaml test with empty indices (#125161)
* Add rule retriever yaml test with empty indices * Add more specificity to NodeFeature name
This commit is contained in:
parent
23769da8e3
commit
00c8ad87c7
2 changed files with 76 additions and 1 deletions
|
@ -893,3 +893,74 @@ teardown:
|
|||
- match: { hits.total.value: 2 }
|
||||
- match: { hits.hits.0._id: 'doc1' }
|
||||
- match: { hits.hits.1._id: 'doc4' }
|
||||
|
||||
---
|
||||
"Multi-index search with missing documents does not error":
|
||||
- requires:
|
||||
cluster_features: [ "test_rule_retriever.with_indices_that_dont_return_rank_docs" ]
|
||||
reason: "Fixed in 9.1"
|
||||
|
||||
- do:
|
||||
indices.create:
|
||||
index: test-index-001
|
||||
|
||||
- do:
|
||||
indices.create:
|
||||
index: test-index-002
|
||||
|
||||
- do:
|
||||
bulk:
|
||||
refresh: true
|
||||
index: test-index-001
|
||||
body:
|
||||
- index:
|
||||
_id: 1
|
||||
- { "text": "patio" }
|
||||
- index:
|
||||
_id: 2
|
||||
- { "text": "catio" }
|
||||
|
||||
- do:
|
||||
bulk:
|
||||
refresh: true
|
||||
index: test-index-002
|
||||
body:
|
||||
- index:
|
||||
_id: 3
|
||||
- { "text": "balcony" }
|
||||
- index:
|
||||
_id: 4
|
||||
- { "text": "overhang" }
|
||||
|
||||
- do:
|
||||
query_rules.put_ruleset:
|
||||
ruleset_id: catio-ruleset
|
||||
body:
|
||||
rules:
|
||||
- rule_id: rule1
|
||||
type: pinned
|
||||
criteria:
|
||||
- type: exact
|
||||
metadata: foo
|
||||
values: [ bar ]
|
||||
actions:
|
||||
ids:
|
||||
- '2'
|
||||
|
||||
- do:
|
||||
search:
|
||||
body:
|
||||
retriever:
|
||||
rule:
|
||||
retriever:
|
||||
standard:
|
||||
query:
|
||||
query_string:
|
||||
query: "patio or balcony"
|
||||
match_criteria:
|
||||
foo: bar
|
||||
ruleset_ids: catio-ruleset
|
||||
|
||||
- match: { hits.total.value: 3 }
|
||||
- match: { hits.hits.0._id: '2' }
|
||||
|
||||
|
|
|
@ -30,6 +30,9 @@ public class InferenceFeatures implements FeatureSpecification {
|
|||
private static final NodeFeature TEST_RERANKING_SERVICE_PARSE_TEXT_AS_SCORE = new NodeFeature(
|
||||
"test_reranking_service.parse_text_as_score"
|
||||
);
|
||||
private static final NodeFeature TEST_RULE_RETRIEVER_WITH_INDICES_THAT_DONT_RETURN_RANK_DOCS = new NodeFeature(
|
||||
"test_rule_retriever.with_indices_that_dont_return_rank_docs"
|
||||
);
|
||||
|
||||
@Override
|
||||
public Set<NodeFeature> getTestFeatures() {
|
||||
|
@ -51,7 +54,8 @@ public class InferenceFeatures implements FeatureSpecification {
|
|||
SEMANTIC_KNN_FILTER_FIX,
|
||||
TEST_RERANKING_SERVICE_PARSE_TEXT_AS_SCORE,
|
||||
SemanticTextFieldMapper.SEMANTIC_TEXT_BIT_VECTOR_SUPPORT,
|
||||
SemanticTextFieldMapper.SEMANTIC_TEXT_HANDLE_EMPTY_INPUT
|
||||
SemanticTextFieldMapper.SEMANTIC_TEXT_HANDLE_EMPTY_INPUT,
|
||||
TEST_RULE_RETRIEVER_WITH_INDICES_THAT_DONT_RETURN_RANK_DOCS
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue