Class PageContentIndexingConnector
java.lang.Object
org.exoplatform.container.component.BaseComponentPlugin
org.exoplatform.commons.search.index.IndexingServiceConnector
org.exoplatform.commons.search.index.impl.ElasticIndexingServiceConnector
io.meeds.social.cms.storage.elasticsearch.PageContentIndexingConnector
- All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin
public class PageContentIndexingConnector
extends org.exoplatform.commons.search.index.impl.ElasticIndexingServiceConnector
Indexes a portal Page's content blocks bound through a
CMSSetting
whose type is backed by a registered PageContentBlockPlugin —
generic across content-block types, no knowledge of any specific addon
(e.g. Notes' Single Note View).
A page can carry more than one content block (e.g. several Single Note View blocks placed in different sections of the same page); each one is indexed as its own document, so that unified search returns one result per block rather than a single blended excerpt for the whole page.
The document id is <page's numeric storage id>_<block hash> (not
PageKey.format(), which can exceed the 50-character limit of the
ES_INDEXING_QUEUE.ENTITY_ID column, nor the setting's own name,
which can be arbitrarily long) — the page id portion stays stable across
page/site renames, unlike the formatted key.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe ES field listing the language tags a block actually has content for (the default/no-language content isn't listed — it's always thecontentfield).static final StringThe ES connector/entity type name for indexed page content blocks.Fields inherited from class org.exoplatform.commons.search.index.impl.ElasticIndexingServiceConnector
currentIndex, indexAlias, mapping, previousIndex, previousIndices, reindexOnUpgrade, replicas, shardsFields inherited from class org.exoplatform.commons.search.index.IndexingServiceConnector
connectorName, enableFields inherited from class org.exoplatform.container.component.BaseComponentPlugin
desc, name -
Constructor Summary
ConstructorsConstructorDescriptionPageContentIndexingConnector(io.meeds.social.cms.service.PageContentBlockPluginService pluginService, io.meeds.social.cms.service.CMSService cmsService, org.exoplatform.portal.mop.service.LayoutService layoutService, org.exoplatform.services.resources.LocaleConfigService localeConfigService, io.meeds.social.cms.service.PageUrlResolverService urlResolverService, org.exoplatform.container.xml.InitParams initParams) -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbuildBlockId(String pageStorageId, String contentType, String settingName) static StringcontentFieldName(String lang) org.exoplatform.commons.search.domain.DocumentgetAllIds(int offset, int limit) static longparsePageId(String blockId) org.exoplatform.commons.search.domain.DocumentMethods inherited from class org.exoplatform.commons.search.index.impl.ElasticIndexingServiceConnector
delete, getAttachmentProcessor, getCurrentIndex, getIndexAlias, getPipelineName, getPreviousIndex, getPreviousIndices, getReindexPipelineName, getReplicas, getShards, isNeedIngestPipeline, isReindexOnUpgrade, setPreviousIndex, setReplicas, setShardsMethods inherited from class org.exoplatform.commons.search.index.IndexingServiceConnector
isEnable, setEnableMethods inherited from class org.exoplatform.container.component.BaseComponentPlugin
getDescription, getName, setDescription, setName
-
Field Details
-
TYPE
The ES connector/entity type name for indexed page content blocks.- See Also:
-
CONTENT_LANGUAGES_FIELD
The ES field listing the language tags a block actually has content for (the default/no-language content isn't listed — it's always thecontentfield). Lets the search side apply its "only excerpt in the searching user's own language" rule without having to pull every language's full text back in_source.- See Also:
-
-
Constructor Details
-
PageContentIndexingConnector
public PageContentIndexingConnector(io.meeds.social.cms.service.PageContentBlockPluginService pluginService, io.meeds.social.cms.service.CMSService cmsService, org.exoplatform.portal.mop.service.LayoutService layoutService, org.exoplatform.services.resources.LocaleConfigService localeConfigService, io.meeds.social.cms.service.PageUrlResolverService urlResolverService, org.exoplatform.container.xml.InitParams initParams)
-
-
Method Details
-
getConnectorName
- Specified by:
getConnectorNamein classorg.exoplatform.commons.search.index.IndexingServiceConnector
-
getMapping
- Overrides:
getMappingin classorg.exoplatform.commons.search.index.impl.ElasticIndexingServiceConnector
-
getAllIds
- Specified by:
getAllIdsin classorg.exoplatform.commons.search.index.IndexingServiceConnector
-
create
- Specified by:
createin classorg.exoplatform.commons.search.index.IndexingServiceConnector
-
update
- Specified by:
updatein classorg.exoplatform.commons.search.index.IndexingServiceConnector
-
contentFieldName
- Parameters:
lang- language tag, empty string for the default/no-language content- Returns:
- the ES field name holding that language's content
-
buildBlockId
- Parameters:
pageStorageId- the storage id of the page carrying the blockcontentType- the content block's content typesettingName- the content block's setting name- Returns:
- the document id for the content block named
settingName(of typecontentType) bound to the page whose storage id ispageStorageId.
-
parsePageId
- Parameters:
blockId- a content block document id (buildBlockId) or a plain page storage id — either way, the leadingpage_<numeric DB id>portion is parsed out.- Returns:
- the numeric storage id of the page carrying the block.
-