Searched defs:random (Results 1 - 25 of 85) sorted by relevance

1234

/lucene-3.6.0/lucene/contrib/facet/src/java/org/apache/lucene/facet/search/sampling/
H A DRandomSampler.java28 * Simple random sampler
32 private final Random random; field in class:RandomSampler
36 this.random = new Random();
39 public RandomSampler(SamplingParams params, Random random) throws IllegalArgumentException { argument
41 this.random = random;
51 // select sample docs with random skipStep, make sure to leave sufficient #docs for selection after last skip
53 int skipStep = 1 + random.nextInt(maxStep);
/lucene-3.6.0/lucene/contrib/queryparser/src/test/org/apache/lucene/queryParser/surround/query/
H A DSingleFieldTestDb.java37 public SingleFieldTestDb(Random random, String[] documents, String fName) { argument
39 db = new MockDirectoryWrapper(random, new RAMDirectory());
44 new MockAnalyzer(random)));
/lucene-3.6.0/lucene/core/src/test/org/apache/lucene/
H A DTestSearch.java49 doTestSearch(random, pw, false);
57 doTestSearch(random, pw, true);
66 private void doTestSearch(Random random, PrintWriter out, boolean useCompoundFile) argument
69 Analyzer analyzer = new MockAnalyzer(random);
H A DTestSearchForDuplicates.java54 doTest(random, pw, false, MAX_DOCS);
62 doTest(random, pw, true, MAX_DOCS);
71 private void doTest(Random random, PrintWriter out, boolean useCompoundFiles, int MAX_DOCS) throws Exception { argument
73 Analyzer analyzer = new MockAnalyzer(random);
/lucene-3.6.0/lucene/core/src/test/org/apache/lucene/index/
H A DTestThreadedForceMerge.java34 private static final Analyzer ANALYZER = new MockAnalyzer(random, MockTokenizer.SIMPLE, true);
49 public void runTest(Random random, Directory directory) throws Exception { argument
135 runTest(random, directory);
H A DTestCrash.java33 private IndexWriter initIndex(Random random, boolean initialCommit) throws IOException { argument
34 return initIndex(random, newDirectory(random), initialCommit);
37 private IndexWriter initIndex(Random random, MockDirectoryWrapper dir, boolean initialCommit) throws IOException { argument
41 TEST_VERSION_CURRENT, new MockAnalyzer(random)).setMaxBufferedDocs(10)
71 IndexWriter writer = initIndex(random, true);
84 IndexWriter writer = initIndex(random, true);
88 writer = initIndex(random, dir, false);
98 IndexWriter writer = initIndex(random, false);
101 writer = initIndex(random, di
[all...]
H A DTestIndexWriterNRTIsCurrent.java41 new MockAnalyzer(random));
50 atLeast(500), random, latch);
78 private final Random random; field in class:TestIndexWriterNRTIsCurrent.WriterThread
84 Random random, CountDownLatch latch) {
89 this.random = random;
102 float nextOp = random.nextFloat();
119 if (random.nextBoolean()) {
83 WriterThread(ReaderHolder holder, IndexWriter writer, int numOps, Random random, CountDownLatch latch) argument
/lucene-3.6.0/lucene/core/src/test/org/apache/lucene/store/
H A DTestMultiMMap.java99 random.nextBytes(bytes);
118 random.nextBytes(bytes);
141 assertChunking(random, _TestUtil.nextInt(random, 20, 100));
144 private void assertChunking(Random random, int chunkSize) throws Exception { argument
153 MockDirectoryWrapper dir = new MockDirectoryWrapper(random, mmapDir);
154 RandomIndexWriter writer = new RandomIndexWriter(random, dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random)).setMergePolicy(newLogMergePolicy()));
164 junk.setValue(_TestUtil.randomUnicodeString(random));
172 int docID = random
[all...]
/lucene-3.6.0/lucene/core/src/test/org/apache/lucene/util/
H A DTestSetOnce.java32 public SetOnceThread(Random random) { argument
33 RAND = new Random(random.nextLong());
78 threads[i] = new SetOnceThread(random);
/lucene-3.6.0/lucene/test-framework/src/java/org/apache/lucene/analysis/
H A DMockFixedLengthPayloadFilter.java27 * TokenFilter that adds random fixed-length payloads.
31 private final Random random; field in class:MockFixedLengthPayloadFilter
35 public MockFixedLengthPayloadFilter(Random random, TokenStream in, int length) { argument
37 this.random = random;
45 random.nextBytes(bytes);
H A DMockVariableLengthPayloadFilter.java27 * TokenFilter that adds random variable-length payloads.
33 private final Random random; field in class:MockVariableLengthPayloadFilter
37 public MockVariableLengthPayloadFilter(Random random, TokenStream in) { argument
39 this.random = random;
46 random.nextBytes(bytes);
47 payload.setData(bytes, 0, random.nextInt(MAXLENGTH));
/lucene-3.6.0/lucene/test-framework/src/java/org/apache/lucene/index/
H A DMockRandomMergePolicy.java30 * MergePolicy that makes random decisions for testing.
33 private final Random random; field in class:MockRandomMergePolicy
35 public MockRandomMergePolicy(Random random) { argument
36 // fork a private random, since we are called
38 this.random = new Random(random.nextLong());
46 if (segmentInfos.size() > 1 && random.nextInt(5) == 3) {
49 Collections.shuffle(segments, random);
53 final int segsToMerge = _TestUtil.nextInt(random, 1, segmentInfos.size());
78 Collections.shuffle(eligibleSegments, random);
[all...]
/lucene-3.6.0/lucene/backwards/src/test/org/apache/lucene/
H A DTestSearch.java56 doTestSearch(random, pw, false);
64 doTestSearch(random, pw, true);
73 private void doTestSearch(Random random, PrintWriter out, boolean useCompoundFile) argument
76 Analyzer analyzer = new MockAnalyzer(random);
/lucene-3.6.0/lucene/backwards/src/test/org/apache/lucene/index/
H A DTestThreadedForceMerge.java34 private static final Analyzer ANALYZER = new MockAnalyzer(random, MockTokenizer.SIMPLE, true);
49 public void runTest(Random random, Directory directory) throws Exception { argument
135 runTest(random, directory);
H A DTestCrash.java33 private IndexWriter initIndex(Random random, boolean initialCommit) throws IOException { argument
34 return initIndex(random, newDirectory(), initialCommit);
37 private IndexWriter initIndex(Random random, MockDirectoryWrapper dir, boolean initialCommit) throws IOException { argument
41 TEST_VERSION_CURRENT, new MockAnalyzer(random)).setMaxBufferedDocs(10)
71 IndexWriter writer = initIndex(random, true);
84 IndexWriter writer = initIndex(random, true);
88 writer = initIndex(random, dir, false);
98 IndexWriter writer = initIndex(random, false);
101 writer = initIndex(random, dir, false);
122 IndexWriter writer = initIndex(random, fals
[all...]
H A DTestIndexWriterNRTIsCurrent.java41 new MockAnalyzer(random));
50 atLeast(500), random, latch);
78 private final Random random; field in class:TestIndexWriterNRTIsCurrent.WriterThread
84 Random random, CountDownLatch latch) {
89 this.random = random;
102 float nextOp = random.nextFloat();
119 if (random.nextBoolean()) {
83 WriterThread(ReaderHolder holder, IndexWriter writer, int numOps, Random random, CountDownLatch latch) argument
/lucene-3.6.0/lucene/backwards/src/test/org/apache/lucene/store/
H A DTestMultiMMap.java69 random.nextBytes(bytes);
88 random.nextBytes(bytes);
111 assertChunking(random, _TestUtil.nextInt(random, 20, 100));
114 private void assertChunking(Random random, int chunkSize) throws Exception { argument
123 MockDirectoryWrapper dir = new MockDirectoryWrapper(random, mmapDir);
124 RandomIndexWriter writer = new RandomIndexWriter(random, dir, newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random)).setMergePolicy(newLogMergePolicy()));
134 junk.setValue(_TestUtil.randomUnicodeString(random));
142 int docID = random
[all...]
/lucene-3.6.0/lucene/backwards/src/test/org/apache/lucene/util/
H A DTestSetOnce.java32 public SetOnceThread(Random random) { argument
33 RAND = new Random(random.nextLong());
78 threads[i] = new SetOnceThread(random);
/lucene-3.6.0/lucene/backwards/src/test-framework/java/org/apache/lucene/analysis/
H A DMockFixedLengthPayloadFilter.java28 private final Random random; field in class:MockFixedLengthPayloadFilter
32 public MockFixedLengthPayloadFilter(Random random, TokenStream in, int length) { argument
34 this.random = random;
42 random.nextBytes(bytes);
H A DMockVariableLengthPayloadFilter.java30 private final Random random; field in class:MockVariableLengthPayloadFilter
34 public MockVariableLengthPayloadFilter(Random random, TokenStream in) { argument
36 this.random = random;
43 random.nextBytes(bytes);
44 payload.setData(bytes, 0, random.nextInt(MAXLENGTH));
/lucene-3.6.0/lucene/backwards/src/test-framework/java/org/apache/lucene/index/
H A DMockRandomMergePolicy.java30 private final Random random; field in class:MockRandomMergePolicy
32 public MockRandomMergePolicy(Random random) { argument
33 // fork a private random, since we are called
35 this.random = new Random(random.nextLong());
43 if (segmentInfos.size() > 1 && random.nextInt(5) == 3) {
46 Collections.shuffle(segments, random);
50 final int segsToMerge = _TestUtil.nextInt(random, 1, segmentInfos.size());
75 Collections.shuffle(eligibleSegments, random);
79 int inc = max <= 2 ? max : _TestUtil.nextInt(random,
[all...]
/lucene-3.6.0/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/feeds/
H A DRandomFacetSource.java28 * Simple implementation of a random facet source
41 Random random; field in class:RandomFacetSource
54 int numFacets = 1 + random.nextInt(maxDocFacets-1); // at least one facet to each doc
57 int depth = 1 + random.nextInt(maxFacetDepth-1); // depth 0 is not useful
59 cp.add(Integer.toString(random.nextInt(maxValue)));
76 random = new Random(config.get("rand.seed", 13));
/lucene-3.6.0/lucene/contrib/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/
H A DDeleteByPercentTask.java45 final Random random; field in class:DeleteByPercentTask
49 random = new Random(runData.getConfig().get("delete.percent.rand.seed", 1717));
83 if (random.nextDouble() <= delRate) {
/lucene-3.6.0/lucene/contrib/facet/src/test/org/apache/lucene/facet/taxonomy/directory/
H A DTestDirectoryTaxonomyReader.java123 doTestReadRecreatedTaxono(random, true);
131 doTestReadRecreatedTaxono(random, false);
134 private void doTestReadRecreatedTaxono(Random random, boolean closeReader) throws Exception { argument
157 int k = random.nextInt(n);
184 Directory dir = new RAMDirectory(); // no need for random directories here
/lucene-3.6.0/lucene/contrib/facet/src/test/org/apache/lucene/facet/util/
H A DTestScoredDocIDsUtils.java54 bits.flip(random.nextInt(n));
63 IndexReader reader = createReaderWithNDocs(random, n, dir);
77 IndexReader reader = createReaderWithNDocs(random, maxDoc, dir);
125 IndexReader reader = createReaderWithNDocs(random, N_DOCS, docFactory, dir);
180 static IndexReader createReaderWithNDocs(Random random, int nDocs, Directory directory) throws IOException { argument
181 return createReaderWithNDocs(random, nDocs, new DocumentFactory(nDocs), directory);
222 static IndexReader createReaderWithNDocs(Random random, int nDocs, DocumentFactory docFactory, Directory dir) throws IOException { argument
223 RandomIndexWriter writer = new RandomIndexWriter(random, dir,
224 newIndexWriterConfig(random, TEST_VERSION_CURRENT,
225 new MockAnalyzer(random, MockTokenize
[all...]

Completed in 68 milliseconds

1234