Class ProfileIndexingServiceConnector

java.lang.Object
org.exoplatform.container.component.BaseComponentPlugin
org.exoplatform.commons.search.index.IndexingServiceConnector
org.exoplatform.commons.search.index.impl.ElasticIndexingServiceConnector
org.exoplatform.social.core.jpa.search.ProfileIndexingServiceConnector
All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin

public class ProfileIndexingServiceConnector extends org.exoplatform.commons.search.index.impl.ElasticIndexingServiceConnector
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     

    Fields inherited from class org.exoplatform.commons.search.index.impl.ElasticIndexingServiceConnector

    currentIndex, indexAlias, mapping, previousIndex, previousIndices, reindexOnUpgrade, replicas, shards

    Fields inherited from class org.exoplatform.commons.search.index.IndexingServiceConnector

    connectorName, enable

    Fields inherited from class org.exoplatform.container.component.BaseComponentPlugin

    desc, name
  • Constructor Summary

    Constructors
    Constructor
    Description
    ProfileIndexingServiceConnector(org.exoplatform.container.xml.InitParams initParams, org.exoplatform.social.core.manager.IdentityManager identityManager, IdentityDAO identityDAO, ConnectionDAO connectionDAO, org.exoplatform.social.core.profileproperty.ProfilePropertyService profilePropertyService, io.meeds.social.translation.service.TranslationService translationService, org.exoplatform.portal.config.UserACL userACL, UserPermissionService userPermissionService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.exoplatform.commons.search.domain.Document
     
    getAllIds(int offset, int limit)
     
     
    static String
     
     
    static String
    toIndexedValue(org.exoplatform.social.core.profileproperty.model.ProfilePropertySetting setting, String storedValue, boolean multiValued, io.meeds.social.translation.service.TranslationService translationService)
    The string the profile index holds for one stored value of a profile property: a dropdown option id becomes the option's value joined with - to each of its translated labels, any other value (free text typed before the property became a dropdown included) is kept as stored; the accents are removed for a value of a multi-valued property and for position, as the document does.
    org.exoplatform.commons.search.domain.Document
     

    Methods inherited from class org.exoplatform.commons.search.index.impl.ElasticIndexingServiceConnector

    delete, getAttachmentProcessor, getCurrentIndex, getIndexAlias, getPipelineName, getPreviousIndex, getPreviousIndices, getReindexPipelineName, getReplicas, getShards, isNeedIngestPipeline, isReindexOnUpgrade, setPreviousIndex, setReplicas, setShards

    Methods inherited from class org.exoplatform.commons.search.index.IndexingServiceConnector

    isEnable, setEnable

    Methods inherited from class org.exoplatform.container.component.BaseComponentPlugin

    getDescription, getName, setDescription, setName

    Methods inherited from class Object

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

  • Constructor Details

    • ProfileIndexingServiceConnector

      public ProfileIndexingServiceConnector(org.exoplatform.container.xml.InitParams initParams, org.exoplatform.social.core.manager.IdentityManager identityManager, IdentityDAO identityDAO, ConnectionDAO connectionDAO, org.exoplatform.social.core.profileproperty.ProfilePropertyService profilePropertyService, io.meeds.social.translation.service.TranslationService translationService, org.exoplatform.portal.config.UserACL userACL, UserPermissionService userPermissionService)
  • Method Details

    • getIndexedFieldName

      public static String getIndexedFieldName(String propertyName)
      Parameters:
      propertyName - name of a profile property setting
      Returns:
      the name of the profile index field holding that property's value: a dot, which Elasticsearch reads as an object path, becomes an underscore. Every query on a property value uses this field name.
    • create

      public org.exoplatform.commons.search.domain.Document create(String id)
      Specified by:
      create in class org.exoplatform.commons.search.index.IndexingServiceConnector
    • update

      public org.exoplatform.commons.search.domain.Document update(String id)
      Specified by:
      update in class org.exoplatform.commons.search.index.IndexingServiceConnector
    • getConnectorName

      public String getConnectorName()
      Specified by:
      getConnectorName in class org.exoplatform.commons.search.index.IndexingServiceConnector
    • getAllIds

      public List<String> getAllIds(int offset, int limit)
      Specified by:
      getAllIds in class org.exoplatform.commons.search.index.IndexingServiceConnector
    • getMapping

      public String getMapping()
      Overrides:
      getMapping in class org.exoplatform.commons.search.index.impl.ElasticIndexingServiceConnector
    • toIndexedValue

      public static String toIndexedValue(org.exoplatform.social.core.profileproperty.model.ProfilePropertySetting setting, String storedValue, boolean multiValued, io.meeds.social.translation.service.TranslationService translationService)
      The string the profile index holds for one stored value of a profile property: a dropdown option id becomes the option's value joined with - to each of its translated labels, any other value (free text typed before the property became a dropdown included) is kept as stored; the accents are removed for a value of a multi-valued property and for position, as the document does. A query matching a stored value against the index computes the indexed string through this method, with the setting's multi-valued flag. Known limit: values stored as a list before the property was made single-valued stay indexed as a joined, accent-free string until the user saves the property again; and a plain string value of a multi-valued property, indexed with its accents before this rule, keeps that document until the user's next profile change, so a directory on that value does not list them meanwhile.
      Parameters:
      setting - the property's setting, may be null
      storedValue - the value as the profile stores it
      multiValued - whether the value is one of a multi-valued property's
      translationService - reads the option labels
      Returns:
      the indexed string