|
|||||||||
| 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 File |
directory
|
protected Map<Object,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 |
Class<?>[] |
getPersistenceClasses()
|
String |
getServiceName()
|
boolean |
postInit(TopiaContextImplementor context)
|
boolean |
preInit(TopiaContextImplementor context)
|
void |
recordForIndexation(Object id,
Object[] fields)
During object modification in transaction, this method is called to store all modification, but modification must no be done on index |
SortedSet<IndexEntry> |
search(Map query)
Permet de faire une recherche |
SortedSet<IndexEntry> |
search(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 File directory
protected TopiaContextImplementor context
protected Map<Object,Object[]> indexationMap
| Constructor Detail |
|---|
public LuceneIndexer()
| Method Detail |
|---|
public String getServiceName()
getServiceName in interface TopiaServicepublic Class<?>[] getPersistenceClasses()
getPersistenceClasses in interface TopiaServicepublic void recordForIndexation(Object id, 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 SortedSet<IndexEntry> search(String queryText)
TopiaIndexService
search in interface TopiaIndexServicepublic SortedSet<IndexEntry> search(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 | ||||||||