Package lumis.service.search
Class SearchResource
- java.lang.Object
-
- lumis.service.search.SearchResource
-
@CacheControl(isPrivate=true, maxAge=20) @Path("/lumis/service/search/rest") @StableMinor(version="14.2", sinceVersion="8.1") public class SearchResource extends Object
Search service rest.- Since:
- 8.1.0
- Version:
- $Revision: 24985 $ $Date: 2022-05-02 23:04:30 -0300 (Mon, 02 May 2022) $
-
-
Constructor Summary
Constructors Constructor Description SearchResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Response
goToSearchResults(@NotNull String query, @NotNull String pageId, String interfaceId)
Redirects the request to the nearest page that contains the search results service interface.String
search(@NotNull String userQuery, @NotNull String serviceInterfaceInstanceId, @Min(0L) @Max(10L) Integer autoCompleteSuggestionsCount, @Min(0L) @Max(10L) Integer quickSearchSuggestionsCount)
Executes an auto complete and a quick search using the user query.
-
-
-
Method Detail
-
search
@Path("/autocomplete") @GET @Produces("application/json") public String search(@QueryParam("q") @NotNull @NotNull String userQuery, @QueryParam("ii") @NotNull @NotNull String serviceInterfaceInstanceId, @QueryParam("as") @DefaultValue("5") @Min(0L) @Max(10L) @Min(0L) @Max(10L) Integer autoCompleteSuggestionsCount, @QueryParam("qs") @DefaultValue("5") @Min(0L) @Max(10L) @Min(0L) @Max(10L) Integer quickSearchSuggestionsCount) throws 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:
Exception
- Since:
- 8.1.0
-
goToSearchResults
@Path("/search") @GET @Produces("text/html") public Response goToSearchResults(@QueryParam("q") @NotNull @NotNull String query, @QueryParam("sourcePageId") @NotNull @NotNull String pageId, @QueryParam("targetInterfaceId") @DefaultValue("lumis.service.search.searchResults") 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 tolumis.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:
-
Temporary redirect
: if the search results page could be found and correctly calculated. -
Not found
: if the search results page could not be found. -
Internal server error
: if some error occur during calculation.
- Parameters:
query
- the user query.pageId
- the source page identifier.interfaceId
- the (optional) search results service interface identifier (defaults tolumis.service.search.searchResults
).- Returns:
- the response of the processing.
- Since:
- 9.0.0
-
-
-