lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpou...@apache.org
Subject lucene-solr:master: Avoid creating too many fs directories.
Date Fri, 19 May 2017 07:11:03 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/master 3bb4662e6 -> 629624d5d


Avoid creating too many fs directories.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/629624d5
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/629624d5
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/629624d5

Branch: refs/heads/master
Commit: 629624d5df123e2621403d057daf67b8e01c2073
Parents: 3bb4662
Author: Adrien Grand <jpountz@gmail.com>
Authored: Fri May 19 08:44:13 2017 +0200
Committer: Adrien Grand <jpountz@gmail.com>
Committed: Fri May 19 08:44:13 2017 +0200

----------------------------------------------------------------------
 .../src/test/org/apache/lucene/misc/SweetSpotSimilarityTest.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/629624d5/lucene/misc/src/test/org/apache/lucene/misc/SweetSpotSimilarityTest.java
----------------------------------------------------------------------
diff --git a/lucene/misc/src/test/org/apache/lucene/misc/SweetSpotSimilarityTest.java b/lucene/misc/src/test/org/apache/lucene/misc/SweetSpotSimilarityTest.java
index d21a3ea..a2b324e 100644
--- a/lucene/misc/src/test/org/apache/lucene/misc/SweetSpotSimilarityTest.java
+++ b/lucene/misc/src/test/org/apache/lucene/misc/SweetSpotSimilarityTest.java
@@ -33,6 +33,7 @@ import org.apache.lucene.search.similarities.PerFieldSimilarityWrapper;
 import org.apache.lucene.search.similarities.Similarity;
 import org.apache.lucene.search.similarities.TFIDFSimilarity;
 import org.apache.lucene.store.Directory;
+import org.apache.lucene.store.RAMDirectory;
 import org.apache.lucene.util.LuceneTestCase;
 
 /**
@@ -42,7 +43,7 @@ public class SweetSpotSimilarityTest extends LuceneTestCase {
   
   private static float computeNorm(Similarity sim, String field, int length) throws IOException
{
     String value = IntStream.range(0, length).mapToObj(i -> "a").collect(Collectors.joining("
"));
-    Directory dir = newDirectory();
+    Directory dir = new RAMDirectory();
     IndexWriter w = new IndexWriter(dir, newIndexWriterConfig().setSimilarity(sim));
     w.addDocument(Collections.singleton(newTextField(field, value, Store.NO)));
     DirectoryReader reader = DirectoryReader.open(w);


Mime
View raw message