Interface SearchProvider

    • Method Detail

      • canSuggest

        boolean canSuggest​(GraphService graphService,
                           java.lang.String namespace)
        Defines if the search can provide suggestions to the given namespace
        Parameters:
        namespace - The namespace to make suggestions to.
        Returns:
        True if suggestions can be made, false otherwise
      • getSuggestions

        java.util.List<SearchSuggestion> getSuggestions​(SearchContext searchContext,
                                                        java.lang.String namespace,
                                                        java.lang.String input)
        Provide suggestions for the given namespace, given the input. Be aware that the input may only contain snippets of the actual input, e.g. `Rout` instead of `Routers` (type ahead).
        Parameters:
        searchContext - The SearchContext to allow access to graphs and other configuration
        namespace - The namespace of the current selected provider to make mappings
        input - The current input, may be a snippet of the final input for type ahead support. It is never null or empty.
        Returns:
        A list of suggestions the SearchProvider can use later to resolve to actual Vertices. Be aware, that this should only return actual results, e.g. "Routers" when input was "Rout".
      • getProviderId

        default java.lang.String getProviderId()
        Returns the unique providerId. This is required as there is a 1:n relationship between search provider and namespace, meaning multiple providers may provide suggestions for the same namespace. In order to resolve from the correct suggestion, a 1:1 mapping backwards is required. For this the providerId is used, which in return must be unique over all SearchProvider.
      • resolve

        java.util.List<GenericVertex> resolve​(GraphService graphService,
                                              SearchCriteria searchCriteria)
        Resolves the given SearchCriteria to a list of vertices.
        Parameters:
        graphService - The GraphService to get access to a graph
        searchCriteria - The SearchCriteria to resolve
        Returns:
        A list of vertices matching the SearchCriteria.