Hi all,
I have come up with some basic set of API's for Solr search component.
I have made it generic such that it can use solr or lucene as the backend.
I have also documented in the DEsign proposal.
http://dev.xwiki.org/xwiki/bin/view/Design/SOLRSearchIntegration
*getBackend*
public String getBackend()
*Returns:*
Returns the name of the backend which is currently in use. It could be
Lucene or Solr.
*rebuildIndex*
*
*
*public int rebuildIndex(com.xpn.xwiki.api.XWiki wiki,
com.xpn.xwiki.api.Context context)*
Starts the rebuild of the whole index
*Parameters:*
wiki
context
*Returns:*
Number of documents scheduled for indexing. -1 in case of errors
*
*
*getSearchResults*
*
*
*
*
*
*
*
*
public searchResponse *getSearchResults*(java.lang.String query,
java.lang.string languages,
com.xpn.xwiki.api.XWiki wiki)
Searches the configured Indexes using the specified query for documents in
the given languages.
With virtual wikis enabled in your xwiki installation this will deliver
results from all virtuall wikis.
*Parameters : *
query - query string given by the user
languages - comma separated list of language codes to search in, may be
null to search all languages. Language codes can be:
- default for content having no specific language information
- lower case 2- letter language codes like en, es , fr.
*Returns:*
a searchResponse instance containing the results (i.e) the response objects.
*getSearchResults*
public searchResponse *getSearchResults*(java.lang.String query,
java.lang.String
virtualWikiNames
java.lang.string
languages,
com.xpn.xwiki.api.XWiki
wiki)
Searches the configured Indexes using the specified query for documents in
the given languages belonging to one of the given virtual wikis.
*Parameters : *
query - query string given by the user
languages - comma separated list of language codes to search in, may be
null to search all languages. Language codes can be:
- default for content having no specific language information
- lower case 2- letter language codes like en, es , fr.
virtualWikiNames - Names of the virtual wikis to search in. May be null for
global search.
*Returns:*
a searchResponse instance containing the results (i.e) the response objects.
I'm not sure on whether to expose the startIndex as API
*Admin Module:*
*
*
I has some thoughts on API's for admin settings where one could check the
precision and recall results based on some known documents and could tweak
the boost values accordingly.
Thanking you,
Savitha.