|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.nuiton.wikitty.storage.solr.SolrUtil
public class SolrUtil
| Field Summary |
|---|
| Fields inherited from interface org.nuiton.wikitty.storage.solr.WikittySolrConstant |
|---|
SOLR_ALL_EXTENSIONS, SOLR_EXTENSIONS, 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 Summary | |
|---|---|
SolrUtil()
|
|
| Method Summary | |
|---|---|
static Integer |
convertToInteger(Object value,
String solrFieldName)
Converti un Object en String, si l'objet est de type String un simple cast est fait, si l'objet est un tableau, on prend le 1er element, si le tableau contient plus de 1 element une exception est levee |
static String |
convertToString(Object value,
String solrFieldName)
Converti un Object en String, si l'objet est de type String un simple cast est fait, si l'objet est un tableau, on prend le 1er element, si le tableau contient plus de 1 element une exception est levee |
static void |
copySolrDocument(org.apache.solr.common.SolrDocument source,
org.apache.solr.common.SolrInputDocument dest,
String... fieldToInclude)
Copy solr document |
static void |
copySolrDocument(org.apache.solr.common.SolrDocument source,
org.apache.solr.common.SolrInputDocument dest,
String[] fieldToInclude,
String[] fieldToExclude)
Copy solr document |
static void |
copySolrDocumentExcludeSomeField(org.apache.solr.common.SolrDocument source,
org.apache.solr.common.SolrInputDocument dest,
String... fieldToExclude)
Copy solr document exlude some fields |
static org.apache.solr.client.solrj.response.QueryResponse |
executeQuery(org.apache.solr.client.solrj.SolrServer solrServer,
org.apache.solr.client.solrj.SolrQuery query)
Execute SolrQuery on specified SolrServer and return the result |
static Map<String,org.apache.solr.common.SolrDocument> |
findAllByAttachment(org.apache.solr.client.solrj.SolrServer solrServer,
Collection<String> ids)
Find solr document by TreeNode attachment field |
static Map<String,org.apache.solr.common.SolrDocument> |
findAllByField(org.apache.solr.client.solrj.SolrServer solrServer,
String solrField,
Collection<String> ids)
Find solr document by specified field in argument |
static Map<String,org.apache.solr.common.SolrDocument> |
findAllById(org.apache.solr.client.solrj.SolrServer solrServer,
Collection<String> ids)
Find solr document by id |
static Map<String,org.apache.solr.common.SolrDocument> |
findAllByParents(org.apache.solr.client.solrj.SolrServer solrServer,
Collection<String> ids)
Find solr document by TreeNode parents extra field |
static org.apache.solr.common.SolrDocument |
findById(org.apache.solr.client.solrj.SolrServer solrServer,
String id)
Find solr document by id |
static Set<String> |
getAttachedTreeNode(org.apache.solr.common.SolrDocument doc)
Recherche tous les TreeNode auquel appartient en Attachment l'objet passe en parametre |
static Integer |
getIntFieldValue(org.apache.solr.common.SolrDocument d,
String fieldname)
get value of field in SolrDocument, field must have only one value |
static Integer |
getIntFieldValue(org.apache.solr.common.SolrDocument d,
String fieldname,
WikittyTypes type)
get value of field in SolrDocument, field must have only one value |
static Object |
getOneValue(Object value)
If value is collection or array get only the first element, else juste return value. |
static String |
getSolrFieldName(String fqfieldName,
WikittyTypes type)
if you change this method, change FieldModifier.convertToField(org.nuiton.wikitty.services.WikittyTransaction, java.lang.String)
too |
static String |
getStringFieldValue(org.apache.solr.common.SolrDocument d,
String fieldname)
get value of field in SolrDocument, field must have only one value |
static String |
getStringFieldValue(org.apache.solr.common.SolrDocument d,
String fieldname,
WikittyTypes type)
get value of field in SolrDocument, field must have only one value |
static String |
getStringFieldValue(org.apache.solr.common.SolrInputDocument d,
String fieldname)
get value of field in SolrDocument, field must have only one value |
static String |
getStringFieldValue(org.apache.solr.common.SolrInputDocument d,
String fieldname,
WikittyTypes type)
get value of field in SolrDocument, field must have only one value |
static Collection<String> |
getStringFieldValues(org.apache.solr.common.SolrDocument d,
String fieldname)
|
static Collection<String> |
getStringFieldValues(org.apache.solr.common.SolrDocument d,
String fieldname,
WikittyTypes type)
|
static Collection<String> |
getStringFieldValues(org.apache.solr.common.SolrInputDocument d,
String fieldname)
|
static Collection<String> |
getStringFieldValues(org.apache.solr.common.SolrInputDocument d,
String fieldname,
WikittyTypes type)
|
static String |
quoteForSolr(String s)
Quote s for solr. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SolrUtil()
| Method Detail |
|---|
public static Set<String> getAttachedTreeNode(org.apache.solr.common.SolrDocument doc)
doc - le document representant l'objet
public static org.apache.solr.common.SolrDocument findById(org.apache.solr.client.solrj.SolrServer solrServer,
String id)
solrServer - solR serveurid - to find
public static Map<String,org.apache.solr.common.SolrDocument> findAllById(org.apache.solr.client.solrj.SolrServer solrServer,
Collection<String> ids)
solrServer - solR serveurids - to find
public static Map<String,org.apache.solr.common.SolrDocument> findAllByParents(org.apache.solr.client.solrj.SolrServer solrServer,
Collection<String> ids)
solrServer - solR serverids - id that must be find in parents list
public static Map<String,org.apache.solr.common.SolrDocument> findAllByAttachment(org.apache.solr.client.solrj.SolrServer solrServer,
Collection<String> ids)
solrServer - solR serverids - id that must be find in attachment list
public static Map<String,org.apache.solr.common.SolrDocument> findAllByField(org.apache.solr.client.solrj.SolrServer solrServer,
String solrField,
Collection<String> ids)
solrServer - solR serveursolrField - field where we looking for idsids - ids that must be in solrField
public static org.apache.solr.client.solrj.response.QueryResponse executeQuery(org.apache.solr.client.solrj.SolrServer solrServer,
org.apache.solr.client.solrj.SolrQuery query)
throws org.apache.solr.client.solrj.SolrServerException
solrServer - solR serverquery - to execute
org.apache.solr.client.solrj.SolrServerException - if exception occured on request execution
public static String getSolrFieldName(String fqfieldName,
WikittyTypes type)
FieldModifier.convertToField(org.nuiton.wikitty.services.WikittyTransaction, java.lang.String)
too
fqfieldName - FQ field nametype - of field
public static void copySolrDocument(org.apache.solr.common.SolrDocument source,
org.apache.solr.common.SolrInputDocument dest,
String[] fieldToInclude,
String[] fieldToExclude)
source - solr document sourcedest - solr document destinationfieldToInclude - only copy thes fields, if null or empty, copy all fieldfieldToExclude - to not copy these fields
public static void copySolrDocument(org.apache.solr.common.SolrDocument source,
org.apache.solr.common.SolrInputDocument dest,
String... fieldToInclude)
source - solr document sourcedest - solr document destinationfieldToInclude - only copy this field, if null or empty, copy all field
public static void copySolrDocumentExcludeSomeField(org.apache.solr.common.SolrDocument source,
org.apache.solr.common.SolrInputDocument dest,
String... fieldToExclude)
source - solr document sourcedest - solr document destinationfieldToExclude - not copy these fields
public static Collection<String> getStringFieldValues(org.apache.solr.common.SolrDocument d,
String fieldname)
public static Collection<String> getStringFieldValues(org.apache.solr.common.SolrInputDocument d,
String fieldname)
public static Collection<String> getStringFieldValues(org.apache.solr.common.SolrDocument d,
String fieldname,
WikittyTypes type)
public static Collection<String> getStringFieldValues(org.apache.solr.common.SolrInputDocument d,
String fieldname,
WikittyTypes type)
public static String getStringFieldValue(org.apache.solr.common.SolrInputDocument d,
String fieldname)
d - fieldname -
public static String getStringFieldValue(org.apache.solr.common.SolrInputDocument d,
String fieldname,
WikittyTypes type)
d - fieldname - type - optional type to generate solr field name
public static String getStringFieldValue(org.apache.solr.common.SolrDocument d,
String fieldname)
d - fieldname -
public static String getStringFieldValue(org.apache.solr.common.SolrDocument d,
String fieldname,
WikittyTypes type)
d - fieldname - type - optional type to generate solr field name
public static Integer getIntFieldValue(org.apache.solr.common.SolrDocument d,
String fieldname)
d - fieldname -
public static Integer getIntFieldValue(org.apache.solr.common.SolrDocument d,
String fieldname,
WikittyTypes type)
d - fieldname - type - optional type to generate solr field name
public static String convertToString(Object value,
String solrFieldName)
value -
public static Integer convertToInteger(Object value,
String solrFieldName)
value -
public static Object getOneValue(Object value)
value -
public static String quoteForSolr(String s)
s - to quote
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||