public class SearchQueryUtil extends Object
Constructor and Description |
---|
SearchQueryUtil() |
Modifier and Type | Method and Description |
---|---|
static Map<DocumentTypeField,Float> |
getFieldsBoost(SessionConfig sessionConfig,
String serviceInstanceId,
ITransaction transaction)
Returns the fields boosts of the given service instance or
null if the user is using the default configuration. |
static SearchQuery |
getSearchQuery(String userQuery,
Map<DocumentTypeField,Float> fieldsBoost,
ServiceInstanceConfig searchServiceInstanceConfig,
Collection<String> publishedContextIds,
Collection<SearchQuerySort> sorts,
int startAt,
int maxRows)
Returns the search query using the given parameters.
|
static SearchQuery |
getSearchQuery(String userQuery,
Map<DocumentTypeField,Float> fieldsBoost,
ServiceInstanceConfig searchServiceInstanceConfig,
Collection<String> publishedContextIds,
Collection<SearchQuerySort> sorts,
int startAt,
int maxRows,
boolean forceIncludePublishedContexts)
Returns the search query using the given parameters.
|
static SearchQuery |
getSearchQuery(String userQuery,
ServiceInstanceConfig searchServiceInstanceConfig,
Collection<String> publishedContextIds,
Collection<SearchQuerySort> sorts,
int startAt,
int maxRows)
Returns the search query using the given parameters.
|
static SearchQuery |
getSearchQuery(String userQuery,
ServiceInstanceConfig searchServiceInstanceConfig,
Collection<String> publishedContextIds,
Collection<SearchQuerySort> sorts,
int startAt,
int maxRows,
boolean forceIncludePublishedContexts)
Returns the search query using the given parameters.
|
static void |
setFieldsBoost(SessionConfig sessionConfig,
Map<DocumentTypeField,Float> boosts,
String serviceInstanceId,
ITransaction transaction)
Sets the given fields boosts in the given service instance.
|
public static SearchQuery getSearchQuery(String userQuery, ServiceInstanceConfig searchServiceInstanceConfig, Collection<String> publishedContextIds, Collection<SearchQuerySort> sorts, int startAt, int maxRows) throws PortalException
userQuery
- the user query.searchServiceInstanceConfig
- the search service instance.publishedContextIds
- the search context identifiers.sorts
- the sorting.startAt
- the start at.maxRows
- the max rows.PortalException
public static SearchQuery getSearchQuery(String userQuery, Map<DocumentTypeField,Float> fieldsBoost, ServiceInstanceConfig searchServiceInstanceConfig, Collection<String> publishedContextIds, Collection<SearchQuerySort> sorts, int startAt, int maxRows) throws PortalException
userQuery
- the user query.fieldsBoost
- the field boost configuration, if any.searchServiceInstanceConfig
- the search service instance.publishedContextIds
- the search context identifiers.sorts
- the sorting.startAt
- the start at.maxRows
- the max rows.PortalException
public static SearchQuery getSearchQuery(String userQuery, ServiceInstanceConfig searchServiceInstanceConfig, Collection<String> publishedContextIds, Collection<SearchQuerySort> sorts, int startAt, int maxRows, boolean forceIncludePublishedContexts) throws PortalException
userQuery
- the user query.searchServiceInstanceConfig
- the search service instance.publishedContextIds
- the search context identifiers.sorts
- the sorting.startAt
- the start at.maxRows
- the max rows.PortalException
public static SearchQuery getSearchQuery(String userQuery, Map<DocumentTypeField,Float> fieldsBoost, ServiceInstanceConfig searchServiceInstanceConfig, Collection<String> publishedContextIds, Collection<SearchQuerySort> sorts, int startAt, int maxRows, boolean forceIncludePublishedContexts) throws PortalException
userQuery
- the user query.fieldsBoost
- the field boost configuration, if any.searchServiceInstanceConfig
- the search service instance.publishedContextIds
- the search context identifiers.sorts
- the sorting.startAt
- the start at.maxRows
- the max rows.PortalException
public static Map<DocumentTypeField,Float> getFieldsBoost(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction) throws PortalException
null
if the user is using the default configuration.sessionConfig
- the user's session.serviceInstanceId
- the service instance identifier.transaction
- the transaction.null
if the user is using the default configuration.PortalException
public static void setFieldsBoost(SessionConfig sessionConfig, Map<DocumentTypeField,Float> boosts, String serviceInstanceId, ITransaction transaction) throws PortalException
boosts
is null
, than the configuration will be removed.sessionConfig
- the user's session.boosts
- the boosts.serviceInstanceId
- the service instance identifier.transaction
- the transaction.PortalException
LumisXP 12.0.0.190809 - Copyright © 2006–2019 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.