Hello all,

I am writing my own handler, and I would like to pre-filter the results based 
on a field. I’m calling searcher.getDocList() with a custom constructed query 
and filters list, but the filters always seem to AND together. My question is 
this: how can I construct the List<Query> of filters to make them OR together 
(documents are included in results if they match *any* of my filters)?

For reference, here’s how I’m constructing my filters:

  List<Query> filters = new LinkedList<Query>();

  . . .

  while (fieldIter.hasNext()) {
      String filterStr = fieldIter.next();
      filters.add(new TermQuery(new Term(accessField, filterStr)));  // 
accessField is known ahead of time
  }

  . . . 

  results.docList = s.getDocList(finalQuery, filters.size() != 0 ? filters : 
null,
      Sort.RELEVANCE, start, indexSize, SolrIndexSearcher.GET_SCORES);


Thanks for any help
Anthony

PS: you might notice that I'm asking for ALL of the results in that search. 
Never fear - I do a lot of post processing myself, and return a sane (~1000) 
amount of results in JSON.

Reply via email to