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:
Kathleen DeRusso 2025-03-19 12:12:20 -04:00 committed by GitHub
parent 23769da8e3
commit 00c8ad87c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 76 additions and 1 deletions

View file

@ -893,3 +893,74 @@ teardown:
- match: { hits.total.value: 2 } - match: { hits.total.value: 2 }
- match: { hits.hits.0._id: 'doc1' } - match: { hits.hits.0._id: 'doc1' }
- match: { hits.hits.1._id: 'doc4' } - 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' }

View file

@ -30,6 +30,9 @@ public class InferenceFeatures implements FeatureSpecification {
private static final NodeFeature TEST_RERANKING_SERVICE_PARSE_TEXT_AS_SCORE = new NodeFeature( private static final NodeFeature TEST_RERANKING_SERVICE_PARSE_TEXT_AS_SCORE = new NodeFeature(
"test_reranking_service.parse_text_as_score" "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 @Override
public Set<NodeFeature> getTestFeatures() { public Set<NodeFeature> getTestFeatures() {
@ -51,7 +54,8 @@ public class InferenceFeatures implements FeatureSpecification {
SEMANTIC_KNN_FILTER_FIX, SEMANTIC_KNN_FILTER_FIX,
TEST_RERANKING_SERVICE_PARSE_TEXT_AS_SCORE, TEST_RERANKING_SERVICE_PARSE_TEXT_AS_SCORE,
SemanticTextFieldMapper.SEMANTIC_TEXT_BIT_VECTOR_SUPPORT, 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
); );
} }
} }