Skip to content

Instantly share code, notes, and snippets.

@seanstory
Created September 12, 2025 20:41
Show Gist options
  • Select an option

  • Save seanstory/d704443120e20f6c844db10e30066860 to your computer and use it in GitHub Desktop.

Select an option

Save seanstory/d704443120e20f6c844db10e30066860 to your computer and use it in GitHub Desktop.
Linear and RRF retrievers for hybrid search across several semantic fields
{
"retriever": {
"linear": {
"retrievers": [
{
"retriever": {
"rrf": {
"retrievers": [
{
"standard": {
"query": {
"semantic": {
"field": "semantic_name",
"query": query
}
}
}
},
{
"standard": {
"query": {
"match_phrase": {
"index_name": query
}
}
}
}
]
}
},
"weight": 2
},
{
"retriever": {
"rrf": {
"retrievers": [
{
"standard": {
"query": {
"semantic": {
"field": "semantic_description",
"query": query
}
}
}
},
{
"standard": {
"query": {
"match_phrase": {
"meta_description": query
}
}
}
}
]
}
},
"weight": 3
},
{
"retriever": {
"rrf": {
"retrievers": [
{
"standard": {
"query": {
"semantic": {
"field": "semantic_fields",
"query": query
}
}
}
},
{
"standard": {
"query": {
"match_phrase": {
"field_descriptions": query
}
}
}
}
]
}
},
"weight": 1
},
{
"retriever": {
"standard": {
"query": {
"semantic": {
"field": "semantic_mapping",
"query": query
}
}
}
},
"weight": 1
}
]
}
},
"_source": ["index_name"],
"size": 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment