summaryrefslogtreecommitdiffstats
path: root/container-search/src/main/java/com/yahoo/search/query/profile/types/ConversionContext.java
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@gmail.com>2021-09-30 13:46:50 +0200
committerJon Bratseth <bratseth@gmail.com>2021-09-30 13:46:50 +0200
commit9fdcf8f92eaf3b47053fa2c131832dea1c792d0c (patch)
treec4d8f2a7c8297fce1b4b6f07a32ab0daeac35aaa /container-search/src/main/java/com/yahoo/search/query/profile/types/ConversionContext.java
parent1bc2cca4b527bb9a5a8c67744b0796c9fafbe024 (diff)
Pass destination
This allows embedders to switch on it to enable bucket testing and similar.
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.java18
1 files changed, 12 insertions, 6 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 e5b9eb1c1cd..8dfb67a9d5f 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
@@ -12,29 +12,35 @@ import java.util.Map;
*/
public class ConversionContext {
+ private final String destination;
private final CompiledQueryProfileRegistry registry;
private final Embedder embedder;
private final Language language;
- public ConversionContext(CompiledQueryProfileRegistry registry, Embedder embedder, Map<String, String> context) {
+ public ConversionContext(String destination, CompiledQueryProfileRegistry registry, Embedder embedder,
+ Map<String, String> context) {
+ this.destination = destination;
this.registry = registry;
this.embedder = embedder;
this.language = context.containsKey("language") ? Language.fromLanguageTag(context.get("language"))
: Language.UNKNOWN;
}
+ /** Returns the local name of the field which will receive the converted value (or null when this is empty) */
+ public String destination() { return destination; }
+
/** Returns the profile registry, or null if none */
- CompiledQueryProfileRegistry getRegistry() {return registry;}
+ CompiledQueryProfileRegistry registry() {return registry;}
- /** Returns the configured encoder, never null */
- Embedder getEncoder() { return embedder; }
+ /** Returns the configured embedder, never null */
+ Embedder embedder() { return embedder; }
/** Returns the language, which is never null but may be UNKNOWN */
- Language getLanguage() { return language; }
+ Language language() { return language; }
/** Returns an empty context */
public static ConversionContext empty() {
- return new ConversionContext(null, Embedder.throwsOnUse, Map.of());
+ return new ConversionContext(null, null, Embedder.throwsOnUse, Map.of());
}
}