|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mydm.search.SimpleSearch
Simple Search.
Simple Search will search all the metadata elements of all EDocuments of all collections.
Simple Search will also provide the case insensitive search over the metadata. Currently the search uses the XPATH as a query service to the database (XML Database).
The XPATH engine is case sensitive, that means if we are looking for a word "Chemistry" then it will only give the results where it find the word "Chemistry" with capital letter "C". This is not acceptable to a typical search enigne.
The workaround is to capture all the metadata of EDocument and save them as lower case text. So when the search is performed the search string (query string) is converted in to lower case and searched on the lower case complete metadata text.
Database The main collections are container in "md" (/db/md)
The database contains collection named "mdftext" which contains documents (single document per a collection from "md").
Simple Search will search all the documents in this "mdftext" collection.
Advantages of this workaround areNote: currently we use only XPATH 1.0 (XPATH 2.0 and XQuery are not yet supported)
Usage:
String searchterm = "chemical physics";
SimpleSearch ss = new SimpleSearch(searchterm);
SearchResListenerImpl sreslistner = new SearchResListener();
ss.performSearch(srlistener);
Until we say ss.performSearch() the search won't be started.
performSearch()
will run as a thread. The results found
will be notified to the SearchResListener Object (sreslistener).
Constructor Summary | |
SimpleSearch()
Constructor |
|
SimpleSearch(java.lang.String searchstring)
Constructor |
Method Summary | |
void |
addListener(SearchResListener srl)
Adds the Listener to the set of listeners |
SearchResListener |
performSearch()
Performs the search and returns a reference to SearchResListener object. |
void |
performSearch(SearchResListener slistener)
Performs the search in a new thread. |
void |
removeListener(SearchResListener srl)
Removed the listener from the set of listeners. |
void |
run()
|
boolean |
status()
Gives the status of the search. |
void |
stop()
Stops the Searching thread. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleSearch()
public SimpleSearch(java.lang.String searchstring)
searchstring
- search string.Method Detail |
public void performSearch(SearchResListener slistener) throws MyDMException
Search
performSearch
in interface Search
slistener
- SearchResListener
MyDMException
public SearchResListener performSearch() throws MyDMException
Search
performSearch
in interface Search
MyDMException
public boolean status()
Search
status
in interface Search
public void stop()
Search
stop
in interface Search
public void addListener(SearchResListener srl)
Search
addListener
in interface Search
srl
- SearchResListenerpublic void removeListener(SearchResListener srl)
Search
removeListener
in interface Search
srl
- public void run()
run
in interface java.lang.Runnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |