* @return true if the index already exists
* @throws RepositoryIndexException
*/
- protected boolean indexExists()
+ public boolean indexExists()
throws RepositoryIndexException
{
if ( IndexReader.indexExists( indexPath ) )
{
// TODO: give action message if indexing is in progress
- // TODO: return zero results if index doesn't yet exist
-
assert q != null && q.length() != 0;
Configuration configuration = configurationStore.getConfigurationFromStore();
ArtifactRepositoryIndex index = factory.createArtifactRepositoryIndex( indexPath, repository );
+ if ( !index.indexExists() )
+ {
+ addActionError( "The repository is not yet indexed. Please wait, and then try again." );
+ return ERROR;
+ }
+
searchResult = searchLayer.searchGeneral( q, index );
return SUCCESS;
<action name="quickSearch" class="quickSearchAction">
<result name="input">/WEB-INF/jsp/quickSearch.jsp</result>
<result>/WEB-INF/jsp/results.jsp</result>
+ <result name="error">/WEB-INF/jsp/quickSearch.jsp</result>
</action>
<!-- TODO! old actions