Package lumis.doui.search
Class SearchQueryUtil
- java.lang.Object
-
- lumis.doui.search.SearchQueryUtil
-
public class SearchQueryUtil extends Object
Search query utilities.- Since:
- 8.1.0
- Version:
- $Revision: 22372 $ $Date: 2019-02-06 19:01:54 -0200 (Wed, 06 Feb 2019) $
-
-
Constructor Summary
Constructors Constructor Description SearchQueryUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<DocumentTypeField,Float>
getFieldsBoost(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction)
Returns the fields boosts of the given service instance ornull
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.
-
-
-
Method Detail
-
getSearchQuery
public static SearchQuery getSearchQuery(String userQuery, ServiceInstanceConfig searchServiceInstanceConfig, Collection<String> publishedContextIds, Collection<SearchQuerySort> sorts, int startAt, int maxRows) throws PortalException
Returns the search query using the given parameters.- Parameters:
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.- Returns:
- the created search query.
- Throws:
PortalException
- Since:
- 8.1.0
-
getSearchQuery
public static SearchQuery getSearchQuery(String userQuery, Map<DocumentTypeField,Float> fieldsBoost, ServiceInstanceConfig searchServiceInstanceConfig, Collection<String> publishedContextIds, Collection<SearchQuerySort> sorts, int startAt, int maxRows) throws PortalException
Returns the search query using the given parameters.- Parameters:
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.- Returns:
- the created search query.
- Throws:
PortalException
- Since:
- 11.1.0
-
getSearchQuery
public static SearchQuery getSearchQuery(String userQuery, ServiceInstanceConfig searchServiceInstanceConfig, Collection<String> publishedContextIds, Collection<SearchQuerySort> sorts, int startAt, int maxRows, boolean forceIncludePublishedContexts) throws PortalException
Returns the search query using the given parameters.- Parameters:
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.- Returns:
- the created search query.
- Throws:
PortalException
- Since:
- 8.1.0
-
getSearchQuery
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
Returns the search query using the given parameters.- Parameters:
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.- Returns:
- the created search query.
- Throws:
PortalException
- Since:
- 11.1.0
-
getFieldsBoost
public static Map<DocumentTypeField,Float> getFieldsBoost(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction) throws PortalException
Returns the fields boosts of the given service instance ornull
if the user is using the default configuration.- Parameters:
sessionConfig
- the user's session.serviceInstanceId
- the service instance identifier.transaction
- the transaction.- Returns:
- the fields boosts of the given service instance or
null
if the user is using the default configuration. - Throws:
PortalException
- Since:
- 11.1.0
-
setFieldsBoost
public static void setFieldsBoost(SessionConfig sessionConfig, Map<DocumentTypeField,Float> boosts, String serviceInstanceId, ITransaction transaction) throws PortalException
Sets the given fields boosts in the given service instance. If the parameterboosts
isnull
, than the configuration will be removed.- Parameters:
sessionConfig
- the user's session.boosts
- the boosts.serviceInstanceId
- the service instance identifier.transaction
- the transaction.- Throws:
PortalException
- Since:
- 11.1.0
-
-