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="17.0", sinceVersion="8.1") public class SearchResource extends java.lang.Object
Search service rest.- Since:
- 8.1.0
- Version:
- $Revision$ $Date$
-
-
Constructor Summary
Constructors Constructor Description SearchResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.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.
-
-
-
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 javax.ws.rs.core.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 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
-
-
-