comparison src/luan/modules/lucene/LuceneIndex.java @ 1543:1db694d98003

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 20 Sep 2020 16:45:31 -0600
parents dc23c96f5021
children 35601f15ecc3
comparison
equal deleted inserted replaced
1542:d4407e8de707 1543:1db694d98003
221 BytesRef br = new BytesRef(); 221 BytesRef br = new BytesRef();
222 NumericUtils.longToPrefixCoded(value,0,br); 222 NumericUtils.longToPrefixCoded(value,0,br);
223 return new Term(key,br); 223 return new Term(key,br);
224 } 224 }
225 225
226 private static final Set<String> ID_SET = Collections.singleton("id");
227
226 private void backupDelete(Query query) 228 private void backupDelete(Query query)
227 throws IOException, SQLException, LuanException 229 throws IOException, SQLException, LuanException
228 { 230 {
229 if( postgresBackup != null ) { 231 if( postgresBackup != null ) {
230 final List<Long> ids = new ArrayList<Long>(); 232 final List<Long> ids = new ArrayList<Long>();
231 IndexSearcher searcher = openSearcher(); 233 IndexSearcher searcher = openSearcher();
232 try { 234 try {
233 MyCollector col = new MyCollector() { 235 MyCollector col = new MyCollector() {
234 @Override public void collect(int iDoc) throws IOException { 236 @Override public void collect(int iDoc) throws IOException {
235 Document doc = searcher.doc( docBase + iDoc ); 237 Document doc = searcher.doc( docBase + iDoc, ID_SET );
236 Long id = (Long)doc.getField("id").numericValue(); 238 Long id = (Long)doc.getField("id").numericValue();
237 ids.add(id); 239 ids.add(id);
238 } 240 }
239 }; 241 };
240 searcher.search(query,col); 242 searcher.search(query,col);