Is it possible to use both pinned
query and query rules
together in the same DSL request? I have a case where some documents need to be permanently pinned at the top (through rules), but there are dynamic situations where I need to temporarily add additional document IDs to be pinned at the top as well. These extra documents are not part of the original rule logic. Can these approaches be combined in a single query, or is there a recommended way to achieve this behavior?
Hello?
Hey there!
There are a couple of options.
If you want the rule documents to come first, you can set the pinned query as your organic query. If you want the pinned documents to come first, you could consider adding an always match rule. You could do this in a different rule set if you only want it sometimes, and just add it to the rule query or retriever as needed. Rulesets are applied in the order which they are specified.
We are also working on a pinned retriever that will be able to be used alongside the rule retriever, but itβs still in progress.
Hope that helps!!
An update: The pinned retriever PR has been merged, and will be available in Serverless soon and an upcoming future stack release!
Thkkks