コード例 #1
0
 private Path dumpSearchResults(User user, Request request)
     throws ParseException, IOException, FileNotFoundException {
   user = userService.validate(user);
   Query query = searchService.getQuery(request);
   IndexSearcher searcher = getSearcher(request, user);
   Filter f =
       NumericRangeFilter.newLongRange(
           MailSchemaField.date.name(), request.startTime, request.endTime, true, true);
   TopDocs docs = searcher.search(query, f, request.scanSize);
   Path tempFile =
       Files.createTempFile(format("kw-%s-%s", user.id, request.keywordField), ".mailytics.temp");
   PrintWriter writer = new PrintWriter(tempFile.toFile());
   TIntHashSet dupSet = new TIntHashSet();
   for (ScoreDoc sd : docs.scoreDocs) {
     Document doc = searcher.doc(sd.doc);
     String string = doc.get(request.keywordField.name());
     int hash = string.hashCode();
     if (!dupSet.contains(hash)) {
       writer.println(string);
       dupSet.add(hash);
     }
   }
   dupSet.clear();
   writer.close();
   return tempFile;
 }
コード例 #2
0
 public void clear() {
   set.clear();
 }
コード例 #3
0
ファイル: Pool.java プロジェクト: sawie/htm.java
 /** Resets the current connections in preparation for new permanence adjustments. */
 public void resetConnections() {
   synapseConnections.clear();
 }