Package org.ametys.plugins.ai.search
Class AIAdditionalDataIndexer
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.ai.search.AIAdditionalDataIndexer
- All Implemented Interfaces:
AdditionalDataIndexer,DeferredServiceable,LogEnabled,AdditionalWebDataIndexer,Contextualizable
public class AIAdditionalDataIndexer
extends AbstractLogEnabled
implements AdditionalWebDataIndexer, DeferredServiceable, Contextualizable
Indexer for AI additional data.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe content attribute name for a chunkstatic final StringThe creation datetime attribute name for a chunkstatic final StringThe identifier of the embedding usedstatic final StringThe embedding attribute name for a chunkstatic final StringThe solr field name with the content idstatic final StringThe solr field name for embedding vectorstatic final StringThe solr type for chunk embeddingFields inherited from interface org.ametys.cms.indexing.solr.AdditionalDataIndexer
TYPE_CONTENT, TYPE_RESOURCE, TYPE_TRASH_ELEMENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcontextualize(Context context) voiddeferredService(ServiceManager manager) Pass theServiceManagerused to access other components.Get the schema definitions used by this indexer.Get the object/document types supported by this indexer.getUnindexAllQuery(String type) The solr query that returns the documents to delete when unindexing all items of the given typegetUnindexObjectQuery(String ametysObjectId) The list of Solr queries that returns the documents to delete when unindexing the given ametys objectgetUnindexSitemapQuery(String type, String siteName, String sitemapName) The solr query that returns the documents to delete when unindexing all items of the given type in the given sitegetUnindexSiteQuery(String type, String sitename) The solr query that returns the documents to delete when unindexing all items of the given type in the given siteList<org.apache.solr.common.SolrInputDocument> indexAdditionalDocuments(AmetysObject object, org.apache.solr.common.SolrInputDocument document) Index additional object properties in the corresponding document.Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
SOLR_TYPE
The solr type for chunk embedding- See Also:
-
SOLR_EMBEDDING
The solr field name for embedding vector- See Also:
-
SOLR_CONTENT_ID
The solr field name with the content id- See Also:
-
DATA_CHUNK_CONTENT
The content attribute name for a chunk- See Also:
-
DATA_CHUNK_EMBDEDING
The embedding attribute name for a chunk- See Also:
-
DATA_CHUNK_CREATION_DATETIME
The creation datetime attribute name for a chunk- See Also:
-
DATA_CHUNK_CREATOR
The identifier of the embedding used- See Also:
-
-
Constructor Details
-
AIAdditionalDataIndexer
public AIAdditionalDataIndexer()
-
-
Method Details
-
deferredService
Description copied from interface:DeferredServiceablePass theServiceManagerused to access other components.- Specified by:
deferredServicein interfaceDeferredServiceable- Parameters:
manager- TheServiceManagerwhich thisDeferredServiceableuses. Must not benull.- Throws:
ServiceException- if an error occurs
-
contextualize
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
getSupportedTypes
Description copied from interface:AdditionalDataIndexerGet the object/document types supported by this indexer.- Specified by:
getSupportedTypesin interfaceAdditionalDataIndexer- Returns:
- The object or document types supported by this indexer.
-
indexAdditionalDocuments
public List<org.apache.solr.common.SolrInputDocument> indexAdditionalDocuments(AmetysObject object, org.apache.solr.common.SolrInputDocument document) Description copied from interface:AdditionalDataIndexerIndex additional object properties in the corresponding document.- Specified by:
indexAdditionalDocumentsin interfaceAdditionalDataIndexer- Parameters:
object- The object to index.document- The destination document.- Returns:
- Additional documents to index (can be empty).
-
getUnindexObjectQuery
Description copied from interface:AdditionalDataIndexerThe list of Solr queries that returns the documents to delete when unindexing the given ametys object- Specified by:
getUnindexObjectQueryin interfaceAdditionalDataIndexer- Parameters:
ametysObjectId- The id of the ametys object to unindex- Returns:
- The list of Solr queries that returns the documents to delete
- Throws:
Exception- If an error occurs while building the queries
-
getUnindexAllQuery
Description copied from interface:AdditionalDataIndexerThe solr query that returns the documents to delete when unindexing all items of the given type- Specified by:
getUnindexAllQueryin interfaceAdditionalDataIndexer- Parameters:
type- The type of the items to unindex- Returns:
- The solr query that returns the documents to delete. Can be null
- Throws:
Exception- If an error occurs while building the queries
-
getUnindexSiteQuery
Description copied from interface:AdditionalWebDataIndexerThe solr query that returns the documents to delete when unindexing all items of the given type in the given site- Specified by:
getUnindexSiteQueryin interfaceAdditionalWebDataIndexer- Parameters:
type- The type of the items to unindexsitename- The site name of the items to unindex- Returns:
- The solr query that returns the documents to delete. Can be null
- Throws:
Exception- If an error occurs while building the queries
-
getUnindexSitemapQuery
public Query getUnindexSitemapQuery(String type, String siteName, String sitemapName) throws Exception Description copied from interface:AdditionalWebDataIndexerThe solr query that returns the documents to delete when unindexing all items of the given type in the given site- Specified by:
getUnindexSitemapQueryin interfaceAdditionalWebDataIndexer- Parameters:
type- The type of the items to unindexsiteName- The site name of the items to unindexsitemapName- The sitemap name of the items to unindex- Returns:
- The solr query that returns the documents to delete. Can be null
- Throws:
Exception- If an error occurs while building the queries
-
getSchemaDefinitions
Description copied from interface:AdditionalDataIndexerGet the schema definitions used by this indexer.- Specified by:
getSchemaDefinitionsin interfaceAdditionalDataIndexer- Returns:
- The schema definitions used by this indexer.
-