@Override public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException { BitSet bits = new BitSet(); int i = 0; for (int id : getAllowedLuceneIds(context)) { if (acceptDocs == null || acceptDocs.get(id)) { bits.set(id); i++; } } int n = 0; for (int id = 0; id < bits.length(); id++) { if (bits.get(id)) n++; } // LOG.info("bit size=" + bits.size() + " set=" + n + " compared to " + luceneIds.length); return new DocIdBitSet(bits); }
public void setConcepts(File file) throws IOException { conceptFilter = null; if (!file.isFile()) { LOG.warn("concept path " + file + " not a file; defaulting to all concepts"); return; } TIntSet ids = new TIntHashSet(); for (String wpId : FileUtils.readLines(file)) { int wpLocalIDNumb= Integer.valueOf(wpId); if(!isBlacklisted(wpLocalIDNumb)) { ids.add(wpLocalIDNumb); } } conceptFilter = new WpIdFilter(ids.toArray()); LOG.warn("installed " + ids.size() + " concepts for " + language); }