|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.nuiton.topia.index.LuceneIndexer
public class LuceneIndexer
To use this indexer you must have two properties defined in config file:
SortedSet<IndexEntry> result = context.getIndexEngin().search("quelque chose")
SortedSet<IndexEntry> result = context.getIndexEngin().search("class:org.nuiton.chorem.entities.Person name:poussin")
// ou equivalent avec une map
Map m = new HashMap();
m.put("class", "org.nuiton.chorem.entities.Person");
m.put("name", "poussin");
SortedSet<IndexEntry> result = context.getIndexEngin().search(m);
| Field Summary | |
|---|---|
protected TopiaContextImplementor |
context
|
protected java.io.File |
directory
|
protected java.util.Map<java.lang.Object,java.lang.Object[]> |
indexationMap
contient les objets a reindexer car creer, modifier ou supprimer. key: id, value: fields values or null for deletion |
| Fields inherited from interface org.nuiton.topia.index.TopiaIndexService |
|---|
SERVICE_NAME |
| Constructor Summary | |
|---|---|
LuceneIndexer()
|
|
| Method Summary | |
|---|---|
void |
clearLastRecordedIndexation()
called after commit and rollback to clear the modification record |
void |
doIndexation()
This method is called after commit, to indicate to index all record entry add with addForIndexation method |
java.lang.Class<?>[] |
getPersistenceClasses()
|
java.lang.String |
getServiceName()
|
boolean |
postInit(TopiaContextImplementor context)
|
boolean |
preInit(TopiaContextImplementor context)
|
void |
recordForIndexation(java.lang.Object id,
java.lang.Object[] fields)
During object modification in transaction, this method is called to store all modification, but modification must no be done on index |
java.util.SortedSet<IndexEntry> |
search(java.util.Map query)
Permet de faire une recherche |
java.util.SortedSet<IndexEntry> |
search(java.lang.String queryText)
Permet de faire une recherche, par exemple: class:org.nuiton.chorem.entities.Person name:poussin |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.io.File directory
protected TopiaContextImplementor context
protected java.util.Map<java.lang.Object,java.lang.Object[]> indexationMap
| Constructor Detail |
|---|
public LuceneIndexer()
| Method Detail |
|---|
public java.lang.String getServiceName()
getServiceName in interface TopiaServicepublic java.lang.Class<?>[] getPersistenceClasses()
getPersistenceClasses in interface TopiaService
public void recordForIndexation(java.lang.Object id,
java.lang.Object[] fields)
TopiaIndexImplementor
recordForIndexation in interface TopiaIndexImplementorid - topiaId objectfields - object field valuepublic boolean preInit(TopiaContextImplementor context)
preInit in interface TopiaServicepublic boolean postInit(TopiaContextImplementor context)
postInit in interface TopiaServicepublic void clearLastRecordedIndexation()
TopiaIndexImplementor
clearLastRecordedIndexation in interface TopiaIndexImplementorpublic void doIndexation()
TopiaIndexImplementor
doIndexation in interface TopiaIndexImplementorpublic java.util.SortedSet<IndexEntry> search(java.lang.String queryText)
TopiaIndexService
search in interface TopiaIndexServicepublic java.util.SortedSet<IndexEntry> search(java.util.Map query)
TopiaIndexService
search in interface TopiaIndexServicequery - Map that contains field name as key and query in value for
this field
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||