Class SearchResource

    • Constructor Summary

      Constructors 
      Constructor Description
      SearchResource()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Response goToSearchResults​(@NotNull java.lang.String query, @NotNull java.lang.String pageId, java.lang.String interfaceId)
      Redirects the request to the nearest page that contains the search results service interface.
      java.lang.String search​(@NotNull java.lang.String userQuery, @NotNull java.lang.String serviceInterfaceInstanceId, @Min(0L) @Max(10L) java.lang.Integer autoCompleteSuggestionsCount, @Min(0L) @Max(10L) java.lang.Integer quickSearchSuggestionsCount)
      Executes an auto complete and a quick search using the user query.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SearchResource

        public SearchResource()
    • Method Detail

      • search

        @Path("/autocomplete")
        @GET
        @Produces("application/json")
        public java.lang.String search​(@QueryParam("q") @NotNull
                                       @NotNull java.lang.String userQuery,
                                       @QueryParam("ii") @NotNull
                                       @NotNull java.lang.String serviceInterfaceInstanceId,
                                       @QueryParam("as") @DefaultValue("5") @Min(0L) @Max(10L)
                                       @Min(0L) @Max(10L) java.lang.Integer autoCompleteSuggestionsCount,
                                       @QueryParam("qs") @DefaultValue("5") @Min(0L) @Max(10L)
                                       @Min(0L) @Max(10L) java.lang.Integer quickSearchSuggestionsCount)
                                throws java.lang.Exception
        Executes an auto complete and a quick search using the user query.
        Parameters:
        userQuery - the user query.
        serviceInterfaceInstanceId - the search service interface instance identifier.
        autoCompleteSuggestionsCount - the maximum number of auto complete suggestions to return.
        quickSearchSuggestionsCount - the maximum number of quick search results to return.
        Returns:
        the search results.
        Throws:
        java.lang.Exception
        Since:
        8.1.0
      • goToSearchResults

        @Path("/search")
        @GET
        @Produces("text/html")
        public Response goToSearchResults​(@QueryParam("q") @NotNull
                                          @NotNull java.lang.String query,
                                          @QueryParam("sourcePageId") @NotNull
                                          @NotNull java.lang.String pageId,
                                          @QueryParam("targetInterfaceId") @DefaultValue("lumis.service.search.searchResults")
                                          java.lang.String interfaceId)
        Redirects the request to the nearest page that contains the search results service interface.

        Uses the given page identifier parameter as the source page, to calculate the nearest search results page.
        The interface identifier parameter represents the interface identifier of the desired search results interface. It defaults to lumis.service.search.searchResults.
        The query parameter is added to the target URL after the base URL is processed (thus, it will not be added to the WebResource calculation).

        The response will be one of:

        Parameters:
        query - the user query.
        pageId - the source page identifier.
        interfaceId - the (optional) search results service interface identifier (defaults to lumis.service.search.searchResults).
        Returns:
        the response of the processing.
        Since:
        9.0.0