slight cleanup and handling of one cornr case

This commit is contained in:
Eric J. Bowersox 2003-06-14 07:10:56 +00:00
parent 7da8104954
commit 1b15703d3f

View File

@ -236,6 +236,13 @@ class IndexServiceImpl implements IndexService
*--------------------------------------------------------------------------------
*/
private static final void visitAllDocuments(IndexSearcher srch, HitCollector c) throws IOException
{
for (int i=0; i<srch.maxDoc(); i++)
c.collect(i,1.0F);
} // end visitAllDocuments
private final String createTag(String namespace, String name, Object obj) throws IndexException
{
String objtag = m_base.getResolver(namespace,name).getResolverTag(obj);
@ -307,12 +314,6 @@ class IndexServiceImpl implements IndexService
} // end compileQuery
private final void doQuery(String query_string, java.util.Date date_low, java.util.Date date_high,
DynamoUser match_owner, String match_scope, HitCollector output) throws IndexException
{
} // end doQuery
/*--------------------------------------------------------------------------------
* Implementations from interface IndexService
*--------------------------------------------------------------------------------
@ -386,7 +387,10 @@ class IndexServiceImpl implements IndexService
{ // run that puppy!
irdr = IndexReader.open(m_directory);
srch = new IndexSearcher(irdr);
srch.search(query,subc);
if (query==null)
visitAllDocuments(srch,subc);
else
srch.search(query,subc);
rc = subc.outputItems(irdr);
} // end try
@ -426,7 +430,10 @@ class IndexServiceImpl implements IndexService
try
{ // run that puppy!
srch = new IndexSearcher(m_directory);
srch.search(query,cc);
if (query==null)
visitAllDocuments(srch,cc);
else
srch.search(query,cc);
} // end try
catch (IOException e)