public void testFieldCacheTermsFilter() throws Exception { Filter filter = new FieldCacheTermsFilter("category", new String[] {"/health/alternative/chinese", "/technology/computers/ai", "/technology/computers/programming"}); assertEquals("expected 7 hits", 7, TestUtil.hitCount(searcher, allBooks, filter)); }
@Override Filter makeFilter(String fname, BytesRef[] byteRefs) { return new FieldCacheTermsFilter(fname, byteRefs); }
@Override Filter makeFilter(String fname, Iterator<BytesRef> it) { return new FieldCacheTermsFilter(fname, (BytesRef[])IteratorUtils.toArray(it, BytesRef.class)); }