Package io.meeds.notes.legacy.search.es
Class ElasticSearchServiceConnector
java.lang.Object
org.exoplatform.container.component.BaseComponentPlugin
io.meeds.notes.legacy.api.search.SearchServiceConnector
io.meeds.notes.legacy.search.es.ElasticSearchServiceConnector
- All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin
- Direct Known Subclasses:
WikiElasticSearchServiceConnector
@Deprecated(forRemoval=true,
since="6.0.0")
public class ElasticSearchServiceConnector
extends SearchServiceConnector
Deprecated, for removal: This API element is subject to removal in a future version.
Copied from commons-search to this module.
Should be reworked to be more simple.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.static final intDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final intDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.Fields inherited from class org.exoplatform.container.component.BaseComponentPlugin
desc, name -
Constructor Summary
ConstructorsConstructorDescriptionElasticSearchServiceConnector(org.exoplatform.container.xml.InitParams initParams, org.exoplatform.commons.search.es.client.ElasticSearchingClient client) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringbuildDetail(org.json.simple.JSONObject jsonHit, SearchContext searchContext) Deprecated, for removal: This API element is subject to removal in a future version.protected StringbuildFilteredQuery(String query, Collection<String> sites, List<ElasticSearchFilter> filters, int offset, int limit, String sort, String order) Deprecated, for removal: This API element is subject to removal in a future version.protected SearchResultbuildHit(org.json.simple.JSONObject jsonHit, SearchContext searchContext) Deprecated, for removal: This API element is subject to removal in a future version.protected StringbuildQuery(String query, Collection<String> sites, int offset, int limit, String sort, String order) Deprecated, for removal: This API element is subject to removal in a future version.protected Collection<SearchResult> buildResult(String jsonResponse, SearchContext context) Deprecated, for removal: This API element is subject to removal in a future version.protected StringbuilQueryWithEntityId(String query, String id) Deprecated, for removal: This API element is subject to removal in a future version.protected StringescapeReservedCharacters(String query) Deprecated, for removal: This API element is subject to removal in a future version.Escaped reserved characters by ES when using query_string.filteredSearch(SearchContext context, String query, List<ElasticSearchFilter> filters, Collection<String> sites, int offset, int limit, String sort, String order) Deprecated, for removal: This API element is subject to removal in a future version.Search on ES with additional filter on the search query Different Filter are: - Term Filter (Check if a specific term of a field exist) - Not exist Filter (Check if a term not exist) - Exist Filter (check if a term exist)protected StringgetAdditionalFilters(List<ElasticSearchFilter> filters) Deprecated, for removal: This API element is subject to removal in a future version.org.exoplatform.commons.search.es.client.ElasticSearchingClientDeprecated, for removal: This API element is subject to removal in a future version.protected StringDeprecated, for removal: This API element is subject to removal in a future version.getImg()Deprecated, for removal: This API element is subject to removal in a future version.getIndex()Deprecated, for removal: This API element is subject to removal in a future version.protected StringgetMetadataQuery(List<ElasticSearchFilter> filters) Deprecated, for removal: This API element is subject to removal in a future version.protected StringDeprecated, for removal: This API element is subject to removal in a future version.protected StringgetPermissionFilterWiki(String permission) Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.protected StringgetSitesFilter(Collection<String> sitesCollection) Deprecated, for removal: This API element is subject to removal in a future version.protected StringDeprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.protected StringgetTitleFromJsonResult(org.json.simple.JSONObject hitSource) Deprecated, for removal: This API element is subject to removal in a future version.protected LonggetUpdatedDateFromResult(org.json.simple.JSONObject hitSource) Deprecated, for removal: This API element is subject to removal in a future version.protected StringgetUrlFromJsonResult(org.json.simple.JSONObject hitSource, SearchContext context) Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.booleanisIndexed(SearchContext context, String id) Deprecated, for removal: This API element is subject to removal in a future version.Returns the status of the indexation for the id in parameter The connectors must implement this search method, with the parameters below.search(SearchContext context, String query, Collection<String> sites, int offset, int limit, String sort, String order) Deprecated, for removal: This API element is subject to removal in a future version.Returns a collection of search results from the connectors.searchByEntityId(SearchContext context, String query, String entityId) Deprecated, for removal: This API element is subject to removal in a future version.Search on ES with entity id Search keyword in query with an OR And search only for the entity in parametervoidDeprecated, for removal: This API element is subject to removal in a future version.voidDeprecated, for removal: This API element is subject to removal in a future version.voidsetSearchFields(List<String> searchFields) Deprecated, for removal: This API element is subject to removal in a future version.voidsetTitleElasticFieldName(String titleElasticFieldName) Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class io.meeds.notes.legacy.api.search.SearchServiceConnector
getDisplayName, getSearchType, isEnable, isEnabledForAnonymous, setDisplayName, setEnable, setEnabledForAnonymous, setSearchTypeMethods inherited from class org.exoplatform.container.component.BaseComponentPlugin
getDescription, getName, setDescription, setName
-
Field Details
-
HIGHLIGHT_FRAGMENT_SIZE_PARAM_NAME
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
HIGHLIGHT_FRAGMENT_SIZE_DEFAULT_VALUE
public static final int HIGHLIGHT_FRAGMENT_SIZE_DEFAULT_VALUEDeprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
HIGHLIGHT_FRAGMENT_NUMBER_PARAM_NAME
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
HIGHLIGHT_FRAGMENT_NUMBER_DEFAULT_VALUE
public static final int HIGHLIGHT_FRAGMENT_NUMBER_DEFAULT_VALUEDeprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
GROUP
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
WIKI_TYPE
Deprecated, for removal: This API element is subject to removal in a future version.- See Also:
-
-
Constructor Details
-
ElasticSearchServiceConnector
public ElasticSearchServiceConnector(org.exoplatform.container.xml.InitParams initParams, org.exoplatform.commons.search.es.client.ElasticSearchingClient client) Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
search
public Collection<SearchResult> search(SearchContext context, String query, Collection<String> sites, int offset, int limit, String sort, String order) Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:SearchServiceConnectorReturns a collection of search results from the connectors. The connectors must implement this search method, with the parameters below.- Specified by:
searchin classSearchServiceConnector- Parameters:
context- The search context.query- The query statement.sites- Specified sites where the search is performed (for example Acme, or Intranet).offset- The start point from which the search results are returned.limit- The limitation number of search results.sort- The sorting criteria (title, relevancy and date).order- The sorting order (ascending and descending).- Returns:
- The collection of search results.
-
isIndexed
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:SearchServiceConnectorReturns the status of the indexation for the id in parameter The connectors must implement this search method, with the parameters below.- Overrides:
isIndexedin classSearchServiceConnector- Parameters:
context- The search context.id- The id of the element- Returns:
- true if the document is indexed
-
filteredSearch
public Collection<SearchResult> filteredSearch(SearchContext context, String query, List<ElasticSearchFilter> filters, Collection<String> sites, int offset, int limit, String sort, String order) Deprecated, for removal: This API element is subject to removal in a future version.Search on ES with additional filter on the search query Different Filter are: - Term Filter (Check if a specific term of a field exist) - Not exist Filter (Check if a term not exist) - Exist Filter (check if a term exist)- Parameters:
context-query-filters-sites-offset-limit-sort-order-- Returns:
- a collection of SearchResult
-
searchByEntityId
public Collection<SearchResult> searchByEntityId(SearchContext context, String query, String entityId) Deprecated, for removal: This API element is subject to removal in a future version.Search on ES with entity id Search keyword in query with an OR And search only for the entity in parameter- Parameters:
query-entityId-- Returns:
- a collection of SearchResult
-
buildQuery
protected String buildQuery(String query, Collection<String> sites, int offset, int limit, String sort, String order) Deprecated, for removal: This API element is subject to removal in a future version. -
builQueryWithEntityId
Deprecated, for removal: This API element is subject to removal in a future version. -
buildFilteredQuery
protected String buildFilteredQuery(String query, Collection<String> sites, List<ElasticSearchFilter> filters, int offset, int limit, String sort, String order) Deprecated, for removal: This API element is subject to removal in a future version. -
escapeReservedCharacters
Deprecated, for removal: This API element is subject to removal in a future version.Escaped reserved characters by ES when using query_string. Only ~ is not escaped since it is used for fuzzy search parameter. The list of reserved characters is documented at https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#_reserved_characters- Parameters:
query- The unescaped query string- Returns:
- The escaped query string
-
buildResult
Deprecated, for removal: This API element is subject to removal in a future version. -
buildHit
Deprecated, for removal: This API element is subject to removal in a future version. -
buildDetail
Deprecated, for removal: This API element is subject to removal in a future version. -
getUpdatedDateFromResult
Deprecated, for removal: This API element is subject to removal in a future version. -
getUrlFromJsonResult
Deprecated, for removal: This API element is subject to removal in a future version. -
getTitleFromJsonResult
Deprecated, for removal: This API element is subject to removal in a future version. -
getAdditionalFilters
Deprecated, for removal: This API element is subject to removal in a future version. -
getMetadataQuery
Deprecated, for removal: This API element is subject to removal in a future version. -
getFields
Deprecated, for removal: This API element is subject to removal in a future version. -
getPermissionFilter
Deprecated, for removal: This API element is subject to removal in a future version. -
getSitesFilter
Deprecated, for removal: This API element is subject to removal in a future version. -
getPermissionFilterWiki
Deprecated, for removal: This API element is subject to removal in a future version. -
getUserMemberships
Deprecated, for removal: This API element is subject to removal in a future version. -
getSourceFields
Deprecated, for removal: This API element is subject to removal in a future version. -
getIndex
Deprecated, for removal: This API element is subject to removal in a future version. -
setIndex
Deprecated, for removal: This API element is subject to removal in a future version. -
getImg
Deprecated, for removal: This API element is subject to removal in a future version. -
setImg
Deprecated, for removal: This API element is subject to removal in a future version. -
getTitleElasticFieldName
Deprecated, for removal: This API element is subject to removal in a future version. -
setTitleElasticFieldName
Deprecated, for removal: This API element is subject to removal in a future version. -
getSearchFields
Deprecated, for removal: This API element is subject to removal in a future version. -
setSearchFields
Deprecated, for removal: This API element is subject to removal in a future version. -
getClient
public org.exoplatform.commons.search.es.client.ElasticSearchingClient getClient()Deprecated, for removal: This API element is subject to removal in a future version.
-