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 Details

    • HIGHLIGHT_FRAGMENT_SIZE_PARAM_NAME

      public static final String 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_VALUE
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • HIGHLIGHT_FRAGMENT_NUMBER_PARAM_NAME

      public static final String 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_VALUE
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • GROUP

      public static final String GROUP
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • WIKI_TYPE

      public static final String 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: SearchServiceConnector
      Returns a collection of search results from the connectors. The connectors must implement this search method, with the parameters below.
      Specified by:
      search in class SearchServiceConnector
      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

      public boolean isIndexed(SearchContext context, String id)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from class: SearchServiceConnector
      Returns the status of the indexation for the id in parameter The connectors must implement this search method, with the parameters below.
      Overrides:
      isIndexed in class SearchServiceConnector
      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

      protected String builQueryWithEntityId(String query, String id)
      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

      protected String escapeReservedCharacters(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. 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

      protected Collection<SearchResult> buildResult(String jsonResponse, SearchContext context)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • buildHit

      protected SearchResult buildHit(org.json.simple.JSONObject jsonHit, SearchContext searchContext)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • buildDetail

      protected String buildDetail(org.json.simple.JSONObject jsonHit, SearchContext searchContext)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getUpdatedDateFromResult

      protected Long getUpdatedDateFromResult(org.json.simple.JSONObject hitSource)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getUrlFromJsonResult

      protected String getUrlFromJsonResult(org.json.simple.JSONObject hitSource, SearchContext context)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getTitleFromJsonResult

      protected String getTitleFromJsonResult(org.json.simple.JSONObject hitSource)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getAdditionalFilters

      protected String getAdditionalFilters(List<ElasticSearchFilter> filters)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getMetadataQuery

      protected String getMetadataQuery(List<ElasticSearchFilter> filters)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getFields

      protected String getFields()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getPermissionFilter

      protected String getPermissionFilter()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getSitesFilter

      protected String getSitesFilter(Collection<String> sitesCollection)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getPermissionFilterWiki

      protected String getPermissionFilterWiki(String permission)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getUserMemberships

      protected Set<String> getUserMemberships()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getSourceFields

      protected String getSourceFields()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getIndex

      public String getIndex()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setIndex

      public void setIndex(String index)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getImg

      public String getImg()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setImg

      public void setImg(String img)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getTitleElasticFieldName

      public String getTitleElasticFieldName()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setTitleElasticFieldName

      public void setTitleElasticFieldName(String titleElasticFieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getSearchFields

      public List<String> getSearchFields()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • setSearchFields

      public void setSearchFields(List<String> searchFields)
      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.