Class ProfileSearchConnector

java.lang.Object
org.exoplatform.social.core.jpa.search.ProfileSearchConnector

public class ProfileSearchConnector extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Number of value combinations aggregated for a multi-valued property, whose index field holds one joined string per user.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ProfileSearchConnector(org.exoplatform.container.xml.InitParams initParams, org.exoplatform.commons.search.es.client.ElasticSearchingClient client, org.exoplatform.social.core.profileproperty.ProfilePropertyService profilePropertyService, UserPermissionService userPermissionService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    count(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.profile.ProfileFilter filter, org.exoplatform.social.core.relationship.model.Relationship.Type type)
    TODO it will be remove to use "_count" query
    static String
    Escapes a value for a query_string query written inside a JSON string, at two levels: each query_string reserved character is escaped once, then the result is escaped for JSON, so that a backslash, a slash or a double quote in the value reaches Elasticsearch as a literal character.
    getAttributeValues(String propertyName, boolean multiValued, String query, int limit)
    The distinct values the profile index holds for a property, at most limit, most frequent first.
    search(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.profile.ProfileFilter filter, org.exoplatform.social.core.relationship.model.Relationship.Type type, long offset, long limit)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MULTI_VALUED_AGGREGATION_SIZE

      public static final int MULTI_VALUED_AGGREGATION_SIZE
      Number of value combinations aggregated for a multi-valued property, whose index field holds one joined string per user.
      See Also:
  • Constructor Details

    • ProfileSearchConnector

      public ProfileSearchConnector(org.exoplatform.container.xml.InitParams initParams, org.exoplatform.commons.search.es.client.ElasticSearchingClient client, org.exoplatform.social.core.profileproperty.ProfilePropertyService profilePropertyService, UserPermissionService userPermissionService)
  • Method Details

    • search

      public List<String> search(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.profile.ProfileFilter filter, org.exoplatform.social.core.relationship.model.Relationship.Type type, long offset, long limit)
    • count

      public int count(org.exoplatform.social.core.identity.model.Identity identity, org.exoplatform.social.core.profile.ProfileFilter filter, org.exoplatform.social.core.relationship.model.Relationship.Type type)
      TODO it will be remove to use "_count" query
      Parameters:
      identity - the Identity
      filter - the filter
      type - type
      Returns:
      number of identities
    • getAttributeValues

      public List<String> getAttributeValues(String propertyName, boolean multiValued, String query, int limit)
      The distinct values the profile index holds for a property, at most limit, most frequent first. A multi-valued property's field holds one joined string per user: up to MULTI_VALUED_AGGREGATION_SIZE combinations are aggregated, then split, so a value held only in rarer combinations is reached by narrowing with a query. Known limit: the joined string does not tell a separator from a comma inside a value, so a multi-valued value holding a comma (Paris, France) is listed as its pieces (Paris, France), each stripped of its spaces, which the directory clause skips. The values are the index's strings: a multi-valued property's and position's come without their accents.
      Parameters:
      propertyName - the property name, a visible setting's
      multiValued - whether the property is multi-valued
      query - a text the values must contain, ignoring case, may be blank
      limit - the maximum number of values
      Returns:
      the values, as the index holds them
    • escapeESReservedChars

      public static String escapeESReservedChars(String string)
      Escapes a value for a query_string query written inside a JSON string, at two levels: each query_string reserved character is escaped once, then the result is escaped for JSON, so that a backslash, a slash or a double quote in the value reaches Elasticsearch as a literal character.
      Parameters:
      string - value to search for
      Returns:
      the value to write between the quotes of the query JSON string