|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object prefuse.data.tuple.AbstractTupleSet prefuse.data.tuple.DefaultTupleSet prefuse.data.search.SearchTupleSet prefuse.data.search.KeywordSearchTupleSet
public class KeywordSearchTupleSet
SearchTupleSet implementation that performs text searches on indexed Tuple data using the Lucene search engine. Lucene is an open source search engine supporting full text indexing and keyword search. Please refer to the Lucene web page for more information. Note that for this class to be used by prefuse applications, the Lucene classes must be included on the application classpath.
SearchQueryBinding
Field Summary | |
---|---|
protected int |
m_id
|
protected LuceneSearcher |
m_lucene
|
protected IntObjectHashMap |
m_map
|
protected java.lang.String |
m_query
|
protected boolean |
m_storeTermVectors
|
Fields inherited from class prefuse.data.tuple.DefaultTupleSet |
---|
m_tuples |
Fields inherited from interface prefuse.data.event.EventConstants |
---|
ALL_COLUMNS, DELETE, INSERT, UPDATE |
Fields inherited from interface prefuse.data.tuple.TupleSet |
---|
EMPTY_ARRAY |
Constructor Summary | |
---|---|
KeywordSearchTupleSet()
Creates a new KeywordSearchFocusSet using an in-memory search index. |
|
KeywordSearchTupleSet(LuceneSearcher searcher)
Creates a new TextSearchFocusSet with the given LuceneSearcher. |
Method Summary | |
---|---|
void |
clear()
Removes all search hits and clears out the index. |
protected org.apache.lucene.document.Document |
getDocument(int id,
java.lang.String text)
Create a Lucene Document instance with the given document ID and text. |
LuceneSearcher |
getLuceneSearcher()
Get the LuceneSearcher instance used by this class. |
protected Tuple |
getMatchingTuple(org.apache.lucene.document.Document d)
Return the Tuple matching the given Lucene Document, if any. |
java.lang.String |
getQuery()
Returns the current search query, if any. |
IntObjectHashMap |
getTupleMap()
Returns a copy of the mapping from Lucene document IDs to prefuse Tuple instances. |
void |
index(Tuple t,
java.lang.String field)
Index an individual Tuple field, so that it can be searched for. |
boolean |
isUnindexSupported()
Returns false, as unindexing values is not currently supported. |
void |
search(java.lang.String query)
Searches the indexed Tuple fields for matching keywords, using the Lucene search engine. |
void |
unindex(Tuple t,
java.lang.String attrName)
This method throws an exception, as unidexing is not supported. |
Methods inherited from class prefuse.data.search.SearchTupleSet |
---|
addTuple, index, removeTuple |
Methods inherited from class prefuse.data.tuple.DefaultTupleSet |
---|
addInternal, clearInternal, containsTuple, getTupleCount, removeInternal, setTuple, toArray, tuples |
Methods inherited from class prefuse.data.tuple.AbstractTupleSet |
---|
addColumn, addColumn, addColumn, addColumn, addColumns, addPropertyChangeListener, addPropertyChangeListener, addTupleSetListener, fireTupleEvent, fireTupleEvent, fireTupleEvent, getClientProperty, isAddColumnSupported, putClientProperty, removePropertyChangeListener, removePropertyChangeListener, removeTupleSetListener, tuples, tuples |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected IntObjectHashMap m_map
protected java.lang.String m_query
protected LuceneSearcher m_lucene
protected boolean m_storeTermVectors
protected int m_id
Constructor Detail |
---|
public KeywordSearchTupleSet()
public KeywordSearchTupleSet(LuceneSearcher searcher)
searcher
- the LuceneSearcher
to use.Method Detail |
---|
public java.lang.String getQuery()
getQuery
in class SearchTupleSet
public void search(java.lang.String query)
search
in class SearchTupleSet
query
- the query string to search forprotected Tuple getMatchingTuple(org.apache.lucene.document.Document d)
d
- the Document to lookup.
public void index(Tuple t, java.lang.String field)
SearchTupleSet
index
in class SearchTupleSet
t
- the Tuplefield
- the data field to indexSearchTupleSet.index(prefuse.data.Tuple, java.lang.String)
public boolean isUnindexSupported()
isUnindexSupported
in class SearchTupleSet
SearchTupleSet.isUnindexSupported()
public void unindex(Tuple t, java.lang.String attrName)
unindex
in class SearchTupleSet
t
- the TupleattrName
- the data field to unindex
java.lang.UnsupportedOperationException
SearchTupleSet.unindex(prefuse.data.Tuple, java.lang.String)
protected org.apache.lucene.document.Document getDocument(int id, java.lang.String text)
id
- the document IDtext
- the text the Document should contain
public LuceneSearcher getLuceneSearcher()
LuceneSearcher
instance used by this class.
public IntObjectHashMap getTupleMap()
public void clear()
clear
in interface TupleSet
clear
in class DefaultTupleSet
TupleSet.clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |