public class DocumentBuilder extends Object
Constructor and Description |
---|
DocumentBuilder(IndexSchema schema) |
Modifier and Type | Method and Description |
---|---|
void |
addField(SchemaField sfield,
String val,
float boost)
Add the specified
SchemaField to the document. |
void |
addField(String name,
String val)
Add the Field and value to the document, invoking the copyField mechanism
|
void |
addField(String name,
String val,
float boost)
Add the Field and value to the document with the specified boost, invoking the copyField mechanism
|
protected void |
addSingleField(SchemaField sfield,
String val,
float boost) |
void |
endDoc() |
Document |
getDoc() |
void |
startDoc() |
static Document |
toDocument(SolrInputDocument doc,
IndexSchema schema)
Convert a SolrInputDocument to a lucene Document.
|
public DocumentBuilder(IndexSchema schema)
public void startDoc()
protected void addSingleField(SchemaField sfield, String val, float boost)
public void addField(SchemaField sfield, String val, float boost)
SchemaField
to the document. Does not invoke the copyField mechanism.sfield
- The SchemaField
to addval
- The value to addboost
- The boost factoraddField(String, String)
,
addField(String, String, float)
,
addSingleField(org.apache.solr.schema.SchemaField, String, float)
public void addField(String name, String val)
name
- The name of the fieldval
- The value to addaddField(String, String, float)
,
addField(org.apache.solr.schema.SchemaField, String, float)
,
addSingleField(org.apache.solr.schema.SchemaField, String, float)
public void addField(String name, String val, float boost)
name
- The name of the field.val
- The value to addboost
- The boostaddField(String, String)
,
addField(org.apache.solr.schema.SchemaField, String, float)
,
addSingleField(org.apache.solr.schema.SchemaField, String, float)
public void endDoc()
public Document getDoc() throws IllegalArgumentException
IllegalArgumentException
public static Document toDocument(SolrInputDocument doc, IndexSchema schema)
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.