|
Lucene example source code file (TestLazyBug.java)
The Lucene TestLazyBug.java source code
package org.apache.lucene.index;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.apache.lucene.analysis.MockAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.document.Field;
import org.apache.lucene.document.FieldSelector;
import org.apache.lucene.document.FieldSelectorResult;
import org.apache.lucene.document.Fieldable;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.LuceneTestCase;
/**
* Test demonstrating EOF bug on the last field of the last doc
* if other docs have allready been accessed.
*/
public class TestLazyBug extends LuceneTestCase {
public static int NUM_DOCS = 500;
public static int NUM_FIELDS = 100;
private static String[] data = new String[] {
"now",
"is the time",
"for all good men",
"to come to the aid",
"of their country!",
"this string contains big chars:{\u0111 \u0222 \u0333 \u1111 \u2222 \u3333}",
"this string is a bigger string, mary had a little lamb, little lamb, little lamb!"
};
private static Set<String> dataset = new HashSet
Other Lucene examples (source code examples)Here is a short list of links related to this Lucene TestLazyBug.java source code file: |
| ... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.