Skip to content

Commit 57ca93f

Browse files
authored
Add Elasticsearch specification for query rules retriever (#3078)
* Add Elasticsearch specification for query rules retriever * Linting * Regenerate output * fix merge overwrite
1 parent 0a54766 commit 57ca93f

File tree

3 files changed

+104
-6
lines changed

3 files changed

+104
-6
lines changed

output/schema/schema.json

Lines changed: 81 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/_types/Retriever.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
*/
1919

2020
import { FieldCollapse } from '@global/search/_types/FieldCollapse'
21+
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'
2122
import { QueryVector, QueryVectorBuilder } from '@_types/Knn'
2223
import { float, integer } from '@_types/Numeric'
2324
import { Sort, SortResults } from '@_types/sort'
25+
import { Id } from './common'
2426
import { QueryContainer } from './query_dsl/abstractions'
2527

2628
/**
@@ -35,6 +37,8 @@ export class RetrieverContainer {
3537
rrf?: RRFRetriever
3638
/** A retriever that reranks the top documents based on a reranking model using the InferenceAPI */
3739
text_similarity_reranker?: TextSimilarityReranker
40+
/** A retriever that replaces the functionality of a rule query. */
41+
rule?: RuleRetriever
3842
}
3943

4044
export class RetrieverBase {
@@ -93,3 +97,14 @@ export class TextSimilarityReranker extends RetrieverBase {
9397
/** The document field to be used for text similarity comparisons. This field should contain the text that will be evaluated against the inference_text */
9498
field?: string
9599
}
100+
101+
export class RuleRetriever extends RetrieverBase {
102+
/** The ruleset IDs containing the rules this retriever is evaluating against. */
103+
ruleset_ids: Id[]
104+
/** The match criteria that will determine if a rule in the provided rulesets should be applied. */
105+
match_criteria: UserDefinedValue
106+
/** The retriever whose results rules should be applied to. */
107+
retriever: RetrieverContainer
108+
/** This value determines the size of the individual result set. */
109+
rank_window_size?: integer
110+
}

0 commit comments

Comments
 (0)