Class ProfileSearchConnector
java.lang.Object
org.exoplatform.social.core.jpa.search.ProfileSearchConnector
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intNumber of value combinations aggregated for a multi-valued property, whose index field holds one joined string per user. -
Constructor Summary
ConstructorsConstructorDescriptionProfileSearchConnector(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 TypeMethodDescriptionintcount(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" querystatic StringescapeESReservedChars(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.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)
-
Field Details
-
MULTI_VALUED_AGGREGATION_SIZE
public static final int MULTI_VALUED_AGGREGATION_SIZENumber 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
-
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 Identityfilter- the filtertype- 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 toMULTI_VALUED_AGGREGATION_SIZEcombinations 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 andposition's come without their accents.- Parameters:
propertyName- the property name, a visible setting'smultiValued- whether the property is multi-valuedquery- a text the values must contain, ignoring case, may be blanklimit- the maximum number of values- Returns:
- the values, as the index holds them
-
escapeESReservedChars
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
-