public class DocumentBuilder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private org.apache.lucene.document.Document |
doc |
private java.util.HashMap<java.lang.String,java.lang.String> |
map |
private IndexSchema |
schema |
Constructor and Description |
---|
DocumentBuilder(IndexSchema schema) |
Modifier and Type | Method and Description |
---|---|
private static void |
addField(org.apache.lucene.document.Document doc,
SchemaField field,
java.lang.String val,
float boost) |
void |
addField(SchemaField sfield,
java.lang.String val,
float boost)
Add the specified
SchemaField to the document. |
void |
addField(java.lang.String name,
java.lang.String val)
Add the Field and value to the document, invoking the copyField mechanism
|
void |
addField(java.lang.String name,
java.lang.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,
java.lang.String val,
float boost) |
void |
endDoc() |
org.apache.lucene.document.Document |
getDoc() |
private static java.lang.String |
getID(SolrInputDocument doc,
IndexSchema schema) |
SolrDocument |
loadStoredFields(SolrDocument doc,
org.apache.lucene.document.Document luceneDoc)
Deprecated.
Do Not Use, see SolrPluginUtils.docListToSolrDocumentList instead
|
void |
setBoost(float boost) |
void |
startDoc() |
static org.apache.lucene.document.Document |
toDocument(SolrInputDocument doc,
IndexSchema schema)
Convert a SolrInputDocument to a lucene Document.
|
private final IndexSchema schema
private org.apache.lucene.document.Document doc
private java.util.HashMap<java.lang.String,java.lang.String> map
public DocumentBuilder(IndexSchema schema)
public void startDoc()
protected void addSingleField(SchemaField sfield, java.lang.String val, float boost)
public void addField(SchemaField sfield, java.lang.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(java.lang.String name, java.lang.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(java.lang.String name, java.lang.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 setBoost(float boost)
public void endDoc()
public org.apache.lucene.document.Document getDoc() throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
private static void addField(org.apache.lucene.document.Document doc, SchemaField field, java.lang.String val, float boost)
private static java.lang.String getID(SolrInputDocument doc, IndexSchema schema)
public static org.apache.lucene.document.Document toDocument(SolrInputDocument doc, IndexSchema schema)
@Deprecated public SolrDocument loadStoredFields(SolrDocument doc, org.apache.lucene.document.Document luceneDoc)