public class WikittySearchEngineSolr extends Object implements WikittySearchEngine, WikittySolrConstant
| Modifier and Type | Field and Description |
|---|---|
protected org.nuiton.config.ApplicationConfig |
config |
protected ElementModifier |
elementModifier
Field modifier use to transform to solr format
|
protected FieldModifier |
fieldModifier
Deprecated.
|
protected SolrResource |
solrResource
JTA resource
|
protected org.apache.solr.client.solrj.SolrServer |
solrServer
solr server
|
SOLR_ALL_EXTENSIONS, SOLR_EXTENSIONS, SOLR_FALSE, SOLR_FULLTEXT, SOLR_FULLTEXT_ALL_EXTENSIONS, SOLR_ID, SOLR_NULL_FIELD, SOLR_QUERY_PARSER, SOLR_WIKITTY_PREFIX, SOLR_WIKITTY_SUFFIX, SUFFIX_BINARY, SUFFIX_BOOLEAN, SUFFIX_DATE, SUFFIX_NUMERIC, SUFFIX_SORTABLE, SUFFIX_STRING, SUFFIX_STRING_FULLTEXT, SUFFIX_STRING_LOWERCASE, SUFFIX_WIKITTY, TREENODE_ATTACHED, TREENODE_ATTACHED_ALL, TREENODE_DEPTH, TREENODE_PARENTS, TREENODE_PREFIX, TREENODE_ROOT| Constructor and Description |
|---|
WikittySearchEngineSolr(org.nuiton.config.ApplicationConfig config,
WikittyExtensionStorage extensionStorage)
Init wikitty search engine on solr embedded server.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addToIndexDocument(org.apache.solr.common.SolrInputDocument doc,
Wikitty w,
String fqfieldName)
modify one field in SolrInputDocument
|
protected void |
addToIndexDocument(org.apache.solr.common.SolrInputDocument doc,
WikittyTypes type,
String fqfieldName,
Object fieldValue,
boolean collection)
Ajoute un champs dans un document a indexer
|
protected void |
addTreeIndexField(SolrResource solrResource,
Map<String,org.apache.solr.common.SolrDocument> tree,
AttachmentInTree attachmentInTree)
Update attached extra field on all objects passed in argument
allAttachmentToIndex
|
protected void |
addTreeIndexField(SolrResource solrResource,
org.apache.solr.common.SolrInputDocument doc,
Map<String,org.apache.solr.common.SolrDocument> tree)
Modifie/Ajoute les champs specifique a l'indexation des arbres sur les
TreeNode.
|
void |
clear(WikittyTransaction transaction) |
protected org.apache.solr.common.SolrInputDocument |
createIndexDocument(Wikitty w)
Create all index document to used to modify indexation.
|
void |
delete(WikittyTransaction transaction,
Collection<String> ids)
Plusieurs actions possibles en fontion du type d'objet:
suppression d'un objet NON noeud
suppression de cet objets
suppression de cet objets dans les attachments des noeuds qui le contiennent
suppression d'un noeud d'arbre
suppression du noeud
reindexation des noeuds qui le contenait comme parent
suppression des attached sur les objets contenus dans les attachments de ce noeud
reindexation des objets qui le contenait comme parent dans un champs attached
|
protected void |
destroy()
Method to destroy properly the search engine.
|
PagedResult<String> |
findAllByCriteria(WikittyTransaction transaction,
Criteria criteria) |
WikittyQueryResult<Map<String,Object>> |
findAllByQuery(WikittyTransaction transaction,
WikittyQuery query) |
TreeNodeResult<String> |
findAllChildrenCount(WikittyTransaction transaction,
String wikittyId,
int depth,
boolean count,
Criteria filter)
Si l'argument n'est pas un TreeNode, une exception est levee
|
WikittyQueryResultTreeNode<String> |
findAllChildrenCount(WikittyTransaction transaction,
String wikittyId,
int depth,
boolean count,
WikittyQuery filter)
Si l'argument n'est pas un TreeNode, une exception est levee
|
org.nuiton.config.ApplicationConfig |
getConfig() |
org.apache.solr.client.solrj.SolrServer |
getSolrServer() |
void |
store(WikittyTransaction transaction,
Collection<Wikitty> wikitties,
boolean force) |
protected org.nuiton.config.ApplicationConfig config
protected org.apache.solr.client.solrj.SolrServer solrServer
@Deprecated protected FieldModifier fieldModifier
protected ElementModifier elementModifier
protected SolrResource solrResource
public WikittySearchEngineSolr(org.nuiton.config.ApplicationConfig config,
WikittyExtensionStorage extensionStorage)
extensionStorage - extension storageconfig - app config (can be null)public org.nuiton.config.ApplicationConfig getConfig()
public org.apache.solr.client.solrj.SolrServer getSolrServer()
public void clear(WikittyTransaction transaction)
clear in interface WikittySearchEnginepublic void store(WikittyTransaction transaction, Collection<Wikitty> wikitties, boolean force)
store in interface WikittySearchEnginepublic void delete(WikittyTransaction transaction, Collection<String> ids) throws WikittyException
delete in interface WikittySearchEnginetransaction - wikitty transactionids - to deletesWikittyExceptionprotected void addTreeIndexField(SolrResource solrResource, org.apache.solr.common.SolrInputDocument doc, Map<String,org.apache.solr.common.SolrDocument> tree)
SolrResource il ne
peut etre que dans deux etats. Soit il a ete reindexe pour les arbres
et il a les champs d'indexation arbre. Soit il a pas encore ete reindexe
pour les arbres et dans ce cas il ne doit pas avoir les champs d'indexation
d'arbre. (il est donc interdit d'avoir des champs d'indexation arbre
obsolete si le document est dans SolrResource)solrResource - solR resourcedoc - les documents representant le TreeNodetree - tous les autres noeuds d'arbre dont on pourrait avoir
besoin pour l'indexationprotected void addTreeIndexField(SolrResource solrResource, Map<String,org.apache.solr.common.SolrDocument> tree, AttachmentInTree attachmentInTree)
solrResource - must contains reindexed TreeNode, that contains attachmenttree - solr document for some TreeNode (used when TreeNode not find in solrResource)attachmentInTree - attachment added and removed from TreeNodepublic WikittyQueryResult<Map<String,Object>> findAllByQuery(WikittyTransaction transaction, WikittyQuery query)
findAllByQuery in interface WikittySearchEnginepublic WikittyQueryResultTreeNode<String> findAllChildrenCount(WikittyTransaction transaction, String wikittyId, int depth, boolean count, WikittyQuery filter)
findAllChildrenCount in interface WikittySearchEnginetransaction - wikitty transactionwikittyId - l'objet root du resultatdepth - profondeur souhaite pour la recherche des fils, ou -1 pour touscount - vrai si l'on souhaite avoir le nombre d'attachment associe
au noeud retournefilter - filtre utilise pour compter le nombre d'attachmentprotected void addToIndexDocument(org.apache.solr.common.SolrInputDocument doc,
WikittyTypes type,
String fqfieldName,
Object fieldValue,
boolean collection)
protected void addToIndexDocument(org.apache.solr.common.SolrInputDocument doc,
Wikitty w,
String fqfieldName)
doc - SolrInputDocument to modifyw - wikitty used to find field valuefqfieldName - field to indexprotected org.apache.solr.common.SolrInputDocument createIndexDocument(Wikitty w)
w - all wikitties object to indexprotected void destroy()
public PagedResult<String> findAllByCriteria(WikittyTransaction transaction, Criteria criteria)
findAllByCriteria in interface WikittySearchEnginepublic TreeNodeResult<String> findAllChildrenCount(WikittyTransaction transaction, String wikittyId, int depth, boolean count, Criteria filter)
findAllChildrenCount in interface WikittySearchEnginetransaction - wikitty transactionwikittyId - l'objet root du resultatdepth - profondeur souhaite pour la recherche des filscount - vrai si l'on souhaite avoir le nombre d'attachment associe
au noeud retournefilter - filtre utilise pour compter le nombre d'attachmentCopyright © 2009–2015 CodeLutin. All rights reserved.