summaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/query/profile/types/ConversionContext.java
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@vespa.ai>2024-01-20 12:59:20 +0100
committerJon Bratseth <bratseth@vespa.ai>2024-01-20 12:59:20 +0100
commitadf85e21711e8f1b184309986911b86ed92be89e (patch)
tree30326e9dd717afc0d2850a1c6c5d0e6e67f73a9c /container-search/src/main/java/com/yahoo/search/query/profile/types/ConversionContext.java
parentc18b5805006b83efbeb9fc881e1658a57be28e56 (diff)
Revert "Merge pull request #29905 from vespa-engine/revert-29884-bratseth/param-refs-in-embed"
This reverts commit c6b547c0c2898a324983356aa677ea3082533f7d, reversing changes made to 8c7f8c17ad5e1de5adcc71ee34f2a3c1cd36d6bd.
Diffstat (limited to 'container-search/src/main/java/com/yahoo/search/query/profile/types/ConversionContext.java')
-rw-r--r--container-search/src/main/java/com/yahoo/search/query/profile/types/ConversionContext.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/container-search/src/main/java/com/yahoo/search/query/profile/types/ConversionContext.java b/container-search/src/main/java/com/yahoo/search/query/profile/types/ConversionContext.java
index bef766e7ef9..70f6e405a92 100644
--- a/container-search/src/main/java/com/yahoo/search/query/profile/types/ConversionContext.java
+++ b/container-search/src/main/java/com/yahoo/search/query/profile/types/ConversionContext.java
@@ -15,6 +15,7 @@ public class ConversionContext {
private final String destination;
private final CompiledQueryProfileRegistry registry;
private final Map<String, Embedder> embedders;
+ private final Map<String, String> contextValues;
private final Language language;
public ConversionContext(String destination, CompiledQueryProfileRegistry registry, Embedder embedder,
@@ -30,6 +31,7 @@ public class ConversionContext {
this.embedders = embedders;
this.language = context.containsKey("language") ? Language.fromLanguageTag(context.get("language"))
: Language.UNKNOWN;
+ this.contextValues = context;
}
/** Returns the local name of the field which will receive the converted value (or null when this is empty) */
@@ -44,6 +46,9 @@ public class ConversionContext {
/** Returns the language, which is never null but may be UNKNOWN */
Language language() { return language; }
+ /** Returns a read-only map of context key-values which can be looked up during conversion. */
+ Map<String,String> contextValues() { return contextValues; }
+
/** Returns an empty context */
public static ConversionContext empty() {
return new ConversionContext(null, null, Embedder.throwsOnUse.asMap(), Map.of());