protected long doCount ( String spaceId ) throws IOException { TopDocs result = getIndexSearcher ( ) . search ( buildQuery ( spaceId , null ) , 1 ) ; return result != null ? result . totalHits : - 1 ; }
Count number of documents within a space .