@Component @Named(value="solr") @Singleton public class SolrIndexScriptService extends Object implements org.xwiki.script.service.ScriptService
SolrIndexer
. Queries on the index are performed using XWiki's Query Module API with query type "solr".Modifier and Type | Field and Description |
---|---|
static String |
CONTEXT_LASTEXCEPTION
Field name of the last API exception inserted in context.
|
Constructor and Description |
---|
SolrIndexScriptService() |
Modifier and Type | Method and Description |
---|---|
void |
delete(EntityReference reference)
Delete an indexed entity and all its contained entities recursively.
|
void |
delete(List<EntityReference> references)
Delete multiple entities and all their contained entities recursively.
|
int |
getQueueSize() |
void |
index(EntityReference reference)
Index an entity and all it's contained entities recursively.
|
void |
index(List<EntityReference> references)
Index multiple entities and all their contained entities recursively.
|
EntityReference |
resolve(org.apache.solr.common.SolrDocument document,
EntityType type,
Object... parameters)
Extract an
EntityReference of the specified type from the given SolrDocument (e.g. |
EntityReference |
resolve(org.apache.solr.common.SolrDocument document,
Object... parameters)
Extract an
EntityReference from the given SolrDocument (e.g. |
DocumentReference |
resolveDocument(org.apache.solr.common.SolrDocument document,
Object... parameters)
Extract a
DocumentReference from the given SolrDocument (e.g. |
public static final String CONTEXT_LASTEXCEPTION
public void index(EntityReference reference)
Null reference means the whole farm.
reference
- the reference to index.public void index(List<EntityReference> references)
Null reference means the whole farm.
references
- the references to index.public void delete(EntityReference reference)
Null reference means the whole farm.
reference
- the reference to delete from the index.public void delete(List<EntityReference> references)
Null reference means the whole farm.
references
- the references to delete from the index.public int getQueueSize()
public DocumentReference resolveDocument(org.apache.solr.common.SolrDocument document, Object... parameters)
DocumentReference
from the given SolrDocument
(e.g. search result).document
- the SolrDocument
to extract the DocumentReference
fromparameters
- the parameters to pass to the reference resolver (e.g. in case some reference components are
missing)SolrDocument
public EntityReference resolve(org.apache.solr.common.SolrDocument document, Object... parameters)
EntityReference
from the given SolrDocument
(e.g. search result). The entity type is
inferred from the "type" field which must be specified and must have a valid value (that corresponds to an
existing EntityType
).document
- a SolrDocument
to extract the EntityReference
from (the "type" field must be
specified)parameters
- the parameters to pass to the reference resolver (e.g. in case some reference components are
missing)SolrDocument
public EntityReference resolve(org.apache.solr.common.SolrDocument document, EntityType type, Object... parameters)
EntityReference
of the specified type from the given SolrDocument
(e.g. search
result).document
- a SolrDocument
to extract the EntityReference
fromtype
- the entity typeparameters
- the parameters to pass to the reference resolver (e.g. in case some reference components are
missing)SolrDocument
Copyright © 2004–2022 XWiki. All rights reserved.