public class SolrInputDocumentReader extends Reader
Constructor and Description |
---|
SolrInputDocumentReader(SolrInputDocument doc,
int maxTotalChars,
int maxCharsPerFieldValue)
Creates a character-stream reader that streams all String fields in the document with space as separator
|
SolrInputDocumentReader(SolrInputDocument doc,
String[] fields,
int maxTotalChars,
int maxCharsPerFieldValue,
String fieldValueSep)
Creates a character-stream reader that reads the listed fields in order, with
max lengths as specified.
|
Modifier and Type | Method and Description |
---|---|
static String |
asString(Reader reader)
Gets the whole reader as a String
|
void |
close() |
protected static String[] |
getStringFields(SolrInputDocument doc) |
int |
read(char[] cbuf,
int off,
int len) |
boolean |
ready() |
void |
setEodReturnValue(int eodReturnValue)
Choose another return value than -1 for end of document reached.
|
public SolrInputDocumentReader(SolrInputDocument doc, int maxTotalChars, int maxCharsPerFieldValue)
doc
- Solr input documentmaxCharsPerFieldValue
- max chars to consume per field valuemaxTotalChars
- max chars to consume totalpublic SolrInputDocumentReader(SolrInputDocument doc, String[] fields, int maxTotalChars, int maxCharsPerFieldValue, String fieldValueSep)
doc
- Solr input documentfields
- list of field names to includefieldValueSep
- separator to insert between field valuesmaxCharsPerFieldValue
- max chars to consume per field valuemaxTotalChars
- max chars to consume totalpublic int read(char[] cbuf, int off, int len) throws IOException
read
in class Reader
IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class Reader
IOException
public boolean ready() throws IOException
ready
in class Reader
IOException
public void setEodReturnValue(int eodReturnValue)
eodReturnValue
- integer which defaults to -1public static String asString(Reader reader)
protected static String[] getStringFields(SolrInputDocument doc)
Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.