Class AutoCompletionEntry
- java.lang.Object
-
- com.funnelback.plugin.index.model.querycompletion.AutoCompletionEntry
-
public class AutoCompletionEntry extends Object
Represents an entry to be provided as additional data for auto-completion. In the simplest case, just a trigger can be provided, which causes the trigger string to be available as a possible auto-completion which, if selected, will submit the trigger string itself as a new search query. To include the string 'funnelback' as such a suggestion, the entry would be constructed as follows.
A more complete example which uses all available fields is as follows...AutoCompletionEntry.builder().trigger("funnelback").build()
This example triggers when the user enters a partial query which matches 'funnelback' (with a slightly higher than default priority), displays the text 'Would you like to append 'funnelback enterprise search' to your query?' within a query-extensions category and, if selected, would append 'funnelback enterprise search' to the user's current query and run it. See theAutoCompletionEntry.builder() .trigger("funnelback") .weight(3.14) .display(new PlainText("Would you like to append 'funnelback enterprise search' to your query?")) .category("query-extensions") .action(new ExtendQuery("funnelback enterprise search")) .build()
com.funnelback.plugin.index.model.querycompletion.display
andcom.funnelback.plugin.index.model.querycompletion.action
packages respectively for other types of displays and actions available.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AutoCompletionEntry.AutoCompletionEntryBuilder
-
Field Summary
Fields Modifier and Type Field Description private @NonNull AutoCompletionAction
action
Action that will be performed when the user selects this suggestion.private @NonNull String
category
The category of the suggestion.private @NonNull AutoCompletionDisplay
display
This is what will be displayed to the user for this suggestion.private @NonNull Set<String>
triggers
Contains the text against which the partial query entered by the user is matched.private @NonNull Double
weight
Used to rank suggestions which matches the partial query, in case multiple suggestion matches a given partial query.
-
Constructor Summary
Constructors Constructor Description AutoCompletionEntry(@NonNull Set<String> triggers, @NonNull Double weight, @NonNull AutoCompletionDisplay display, @NonNull String category, @NonNull AutoCompletionAction action)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static AutoCompletionAction
$default$action()
private static String
$default$category()
private static AutoCompletionDisplay
$default$display()
private static Double
$default$weight()
static AutoCompletionEntry.AutoCompletionEntryBuilder
builder()
protected boolean
canEqual(Object other)
boolean
equals(Object o)
@NonNull AutoCompletionAction
getAction()
Action that will be performed when the user selects this suggestion.@NonNull String
getCategory()
The category of the suggestion.@NonNull AutoCompletionDisplay
getDisplay()
This is what will be displayed to the user for this suggestion.@NonNull Set<String>
getTriggers()
Contains the text against which the partial query entered by the user is matched.@NonNull Double
getWeight()
Used to rank suggestions which matches the partial query, in case multiple suggestion matches a given partial query.int
hashCode()
String
toString()
-
-
-
Field Detail
-
triggers
@NonNull private final @NonNull Set<String> triggers
Contains the text against which the partial query entered by the user is matched. Note that the matching is performance case-insensitively. For example if this column contains "Australia", this suggestion will trigger if a user enters "aus". Multiple triggers for a single entry may be declared, which will behave identically to defining many AutoCompletionEntry records which differ only on the trigger field, however future versions of Funnelback may offer improved performance in this case.
-
weight
@NonNull private final @NonNull Double weight
Used to rank suggestions which matches the partial query, in case multiple suggestion matches a given partial query. The expected range is 0-999. If the partial query is "do", both "dog" and "donut" will be returned. The one with the higher weight will be returned first (assuming the auto-completion sort option is set to sort by score).
-
display
@NonNull private @NonNull AutoCompletionDisplay display
This is what will be displayed to the user for this suggestion. See the concrete classes in com.funnelback.plugin.index.model.querycompletion.display for available options.
-
category
@NonNull private @NonNull String category
The category of the suggestion. This field allows to classify suggestion in multiple categories. If the suggestion concerns a product, you could use "Product" here. All the suggestions with the same category will be displayed under the same category header in the search result page.
-
action
@NonNull private @NonNull AutoCompletionAction action
Action that will be performed when the user selects this suggestion. It can be: See the concrete classes in com.funnelback.plugin.index.model.querycompletion.action for available options.
-
-
Constructor Detail
-
AutoCompletionEntry
AutoCompletionEntry(@NonNull @NonNull Set<String> triggers, @NonNull @NonNull Double weight, @NonNull @NonNull AutoCompletionDisplay display, @NonNull @NonNull String category, @NonNull @NonNull AutoCompletionAction action)
-
-
Method Detail
-
$default$weight
private static Double $default$weight()
-
$default$display
private static AutoCompletionDisplay $default$display()
-
$default$category
private static String $default$category()
-
$default$action
private static AutoCompletionAction $default$action()
-
builder
public static AutoCompletionEntry.AutoCompletionEntryBuilder builder()
-
getTriggers
@NonNull public @NonNull Set<String> getTriggers()
Contains the text against which the partial query entered by the user is matched. Note that the matching is performance case-insensitively. For example if this column contains "Australia", this suggestion will trigger if a user enters "aus". Multiple triggers for a single entry may be declared, which will behave identically to defining many AutoCompletionEntry records which differ only on the trigger field, however future versions of Funnelback may offer improved performance in this case.
-
getWeight
@NonNull public @NonNull Double getWeight()
Used to rank suggestions which matches the partial query, in case multiple suggestion matches a given partial query. The expected range is 0-999. If the partial query is "do", both "dog" and "donut" will be returned. The one with the higher weight will be returned first (assuming the auto-completion sort option is set to sort by score).
-
getDisplay
@NonNull public @NonNull AutoCompletionDisplay getDisplay()
This is what will be displayed to the user for this suggestion. See the concrete classes in com.funnelback.plugin.index.model.querycompletion.display for available options.
-
getCategory
@NonNull public @NonNull String getCategory()
The category of the suggestion. This field allows to classify suggestion in multiple categories. If the suggestion concerns a product, you could use "Product" here. All the suggestions with the same category will be displayed under the same category header in the search result page.
-
getAction
@NonNull public @NonNull AutoCompletionAction getAction()
Action that will be performed when the user selects this suggestion. It can be: See the concrete classes in com.funnelback.plugin.index.model.querycompletion.action for available options.
-
canEqual
protected boolean canEqual(Object other)
-
-