Class 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.
    
     AutoCompletionEntry.builder().trigger("funnelback").build()
     
    A more complete example which uses all available fields is as follows...
    
     AutoCompletionEntry.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()
     
    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 the com.funnelback.plugin.index.model.querycompletion.display and com.funnelback.plugin.index.model.querycompletion.action packages respectively for other types of displays and actions available.
    • 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.
    • Method Detail

      • $default$weight

        private static Double $default$weight()
      • $default$category

        private static String $default$category()
      • 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)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object