Hi
I am looking at implementing faceted search using Hibernate Search and have a question and was hoping to get some guidance.
I came across the following code from 
http://forum.hibernate.org/viewtopic.php?t=993752
Code:
public Map<String,Integer> getAllHits(String field) { 
Map<String,Integer> hits = new HashMap<String,Integer>(); 
IndexReader reader = IndexReader.open( getDirectory() ); 
TermEnum terms = reader.terms( new Term( field, "" ) ); 
while( field.equals( terms.term().field() ) ){ 
hits.put( terms.term().text(), terms.docFreq() ); 
if( !terms.next() ) 
break; 
} 
} 
This works really well but I was wondering what approach to take for filtering the results for example only hits for a particular user or a another  search term?
Any help would be appreciated.