public class DocMaker
extends java.lang.Object
Document
objects. Uses a ContentSource
to generate
DocData
objects. Supports the following parameters:
ContentSource
class to use
(default SingleDocSource).
doc.tokenized.norms
is set to false, to allow norms storing just
for the body field. (default true).
DocData.getProps()
will be indexed. (default false).
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BODY_FIELD |
protected org.apache.lucene.document.Field.Index |
bodyIndexVal |
static java.lang.String |
BYTES_FIELD |
protected Config |
config |
static java.lang.String |
DATE_FIELD |
static java.lang.String |
ID_FIELD |
protected boolean |
indexProperties |
protected org.apache.lucene.document.Field.Index |
indexVal |
static java.lang.String |
NAME_FIELD |
protected boolean |
reuseFields |
protected ContentSource |
source |
protected org.apache.lucene.document.Field.Store |
storeVal |
protected org.apache.lucene.document.Field.TermVector |
termVecVal |
static java.lang.String |
TITLE_FIELD |
Constructor and Description |
---|
DocMaker() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the
DocMaker . |
long |
getBytesCount()
Returns the number of bytes generated by the content source since last
reset.
|
protected org.apache.lucene.benchmark.byTask.feeds.DocMaker.DocState |
getDocState() |
long |
getTotalBytesCount()
Returns the total number of bytes that were generated by the content source
defined to that doc maker.
|
protected int |
incrNumDocsCreated() |
org.apache.lucene.document.Document |
makeDocument()
Creates a
Document object ready for indexing. |
org.apache.lucene.document.Document |
makeDocument(int size)
Same as
makeDocument() , only this method creates a document of the
given size input by size . |
void |
printDocStatistics() |
void |
resetInputs()
Reset inputs so that the test run would behave, input wise, as if it just started.
|
void |
setConfig(Config config)
Set the configuration parameters of this doc maker.
|
public static final java.lang.String BODY_FIELD
public static final java.lang.String TITLE_FIELD
public static final java.lang.String DATE_FIELD
public static final java.lang.String ID_FIELD
public static final java.lang.String BYTES_FIELD
public static final java.lang.String NAME_FIELD
protected Config config
protected org.apache.lucene.document.Field.Store storeVal
protected org.apache.lucene.document.Field.Index indexVal
protected org.apache.lucene.document.Field.Index bodyIndexVal
protected org.apache.lucene.document.Field.TermVector termVecVal
protected ContentSource source
protected boolean reuseFields
protected boolean indexProperties
protected org.apache.lucene.benchmark.byTask.feeds.DocMaker.DocState getDocState()
protected int incrNumDocsCreated()
public void close() throws java.io.IOException
DocMaker
. The base implementation closes the
ContentSource
, and it can be overridden to do more work (but make
sure to call super.close()).java.io.IOException
public long getBytesCount()
public long getTotalBytesCount()
public org.apache.lucene.document.Document makeDocument() throws java.lang.Exception
Document
object ready for indexing. This method uses the
ContentSource
to get the next document from the source, and creates
a Document
object from the returned fields. If
reuseFields
was set to true, it will reuse Document
and Field
instances.java.lang.Exception
public org.apache.lucene.document.Document makeDocument(int size) throws java.lang.Exception
makeDocument()
, only this method creates a document of the
given size input by size
.java.lang.Exception
public void printDocStatistics()
public void resetInputs() throws java.io.IOException
java.io.IOException
public void setConfig(Config config)
Copyright © 2000-2016 Apache Software Foundation. All Rights Reserved.