Package org.apache.lucene.tests.index
Class DocHelper
java.lang.Object
org.apache.lucene.tests.index.DocHelper
Helper functions for tests that handles documents
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Map
<String, IndexableField> static final FieldType
static final FieldType
static final FieldType
static final FieldType
static final FieldType
static final FieldType
static final String
static final int[]
static final String
static final String
static final String
static final int[]
static final String
static final Field[]
static final Map
<String, IndexableField> static final Field
static final String
static final String
static final String
static String
static Field
static final Map
<String, IndexableField> static byte[]
static final String
static final String
static final String
static final Field
static Field
static final String
static final String
static final String
static final String
static final Map
<String, IndexableField> static final Field
static final Map
<String, IndexableField> static final Map
<String, IndexableField> static final Field
static final Map
<String, IndexableField> static final FieldType
static final Map
<String, IndexableField> static final String
static final String
static final String
static final String
static final String
static final FieldType
static final Field
static final Field
static final Field
static final Field
static final Field
static final Map
<String, IndexableField> static final String
static final String
static final Field
static final Map
<String, IndexableField> static final String
static final String
static final String
static final String
static final Field
static final Field
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Document
createDocument
(int n, String indexName, int numFields) static int
static void
Adds the fields above to a documentstatic SegmentCommitInfo
Writes the document to the directory using a segment named "test"; returns the SegmentInfo describing the new segmentstatic SegmentCommitInfo
writeDoc
(Directory dir, Analyzer analyzer, Similarity similarity, Document doc) Writes the document to the directory using the analyzer and the similarity score; returns the SegmentInfo describing the new segment
-
Field Details
-
customType
-
FIELD_1_TEXT
- See Also:
-
TEXT_FIELD_1_KEY
- See Also:
-
textField1
-
TEXT_TYPE_STORED_WITH_TVS
-
FIELD_2_TEXT
- See Also:
-
FIELD_2_FREQS
public static final int[] FIELD_2_FREQS -
TEXT_FIELD_2_KEY
- See Also:
-
textField2
-
customType3
-
FIELD_3_TEXT
- See Also:
-
TEXT_FIELD_3_KEY
- See Also:
-
textField3
-
KEYWORD_TEXT
- See Also:
-
KEYWORD_FIELD_KEY
- See Also:
-
keyField
-
customType5
-
NO_NORMS_TEXT
- See Also:
-
NO_NORMS_KEY
- See Also:
-
noNormsField
-
customType6
-
NO_TF_TEXT
- See Also:
-
NO_TF_KEY
- See Also:
-
noTFField
-
customType7
-
UNINDEXED_FIELD_TEXT
- See Also:
-
UNINDEXED_FIELD_KEY
- See Also:
-
unIndField
-
STRING_TYPE_STORED_WITH_TVS
-
UNSTORED_1_FIELD_TEXT
- See Also:
-
UNSTORED_FIELD_1_KEY
- See Also:
-
unStoredField1
-
customType8
-
UNSTORED_2_FIELD_TEXT
- See Also:
-
UNSTORED_FIELD_2_KEY
- See Also:
-
unStoredField2
-
LAZY_FIELD_BINARY_KEY
- See Also:
-
LAZY_FIELD_BINARY_BYTES
public static byte[] LAZY_FIELD_BINARY_BYTES -
lazyFieldBinary
-
LAZY_FIELD_KEY
- See Also:
-
LAZY_FIELD_TEXT
- See Also:
-
lazyField
-
LARGE_LAZY_FIELD_KEY
- See Also:
-
LARGE_LAZY_FIELD_TEXT
-
largeLazyField
-
FIELD_UTF1_TEXT
- See Also:
-
TEXT_FIELD_UTF1_KEY
- See Also:
-
textUtfField1
-
FIELD_UTF2_TEXT
- See Also:
-
FIELD_UTF2_FREQS
public static final int[] FIELD_UTF2_FREQS -
TEXT_FIELD_UTF2_KEY
- See Also:
-
textUtfField2
-
nameValues
-
fields
-
all
-
indexed
-
stored
-
unstored
-
unindexed
-
termvector
-
notermvector
-
lazy
-
noNorms
-
noTf
-
-
Constructor Details
-
DocHelper
public DocHelper()
-
-
Method Details
-
setupDoc
Adds the fields above to a document- Parameters:
doc
- The document to write
-
writeDoc
public static SegmentCommitInfo writeDoc(Random random, Directory dir, Document doc) throws IOException Writes the document to the directory using a segment named "test"; returns the SegmentInfo describing the new segment- Throws:
IOException
-
writeDoc
public static SegmentCommitInfo writeDoc(Directory dir, Analyzer analyzer, Similarity similarity, Document doc) throws IOException Writes the document to the directory using the analyzer and the similarity score; returns the SegmentInfo describing the new segment- Throws:
IOException
-
numFields
-
createDocument
-