Package org.apache.solr.handler.designer
Class DefaultSampleDocumentsLoader
- java.lang.Object
-
- org.apache.solr.handler.designer.DefaultSampleDocumentsLoader
-
- All Implemented Interfaces:
SampleDocumentsLoader
,NamedListInitializedPlugin
public class DefaultSampleDocumentsLoader extends Object implements SampleDocumentsLoader
-
-
Field Summary
Fields Modifier and Type Field Description static String
CSV_MULTI_VALUE_DELIM_PARAM
-
Constructor Summary
Constructors Constructor Description DefaultSampleDocumentsLoader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected char
detectTSV(String csvStr)
protected List<org.apache.solr.common.SolrInputDocument>
loadCsvDocs(org.apache.solr.common.params.SolrParams params, String source, byte[] streamBytes, String charset, int maxDocsToLoad)
protected List<org.apache.solr.common.SolrInputDocument>
loadJsonDocs(org.apache.solr.common.params.SolrParams params, org.apache.solr.common.util.ContentStreamBase.ByteArrayStream stream, int maxDocsToLoad)
protected List<Map<String,Object>>
loadJsonLines(String[] lines)
protected List<org.apache.solr.common.SolrInputDocument>
loadJsonLines(org.apache.solr.common.params.SolrParams params, org.apache.solr.common.util.ContentStreamBase.ByteArrayStream stream, int maxDocsToLoad)
protected List<org.apache.solr.common.SolrInputDocument>
loadXmlDocs(org.apache.solr.common.params.SolrParams params, org.apache.solr.common.util.ContentStreamBase.ByteArrayStream stream, int maxDocsToLoad)
SampleDocuments
parseDocsFromStream(org.apache.solr.common.params.SolrParams params, org.apache.solr.common.util.ContentStream stream, int maxDocsToLoad)
protected List<org.apache.solr.common.SolrInputDocument>
parseXmlDocs(XMLStreamReader parser, int maxDocsToLoad)
protected String
readInputAsString(InputStream in)
static byte[]
streamAsBytes(InputStream in)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.util.plugin.NamedListInitializedPlugin
init
-
Methods inherited from interface org.apache.solr.handler.designer.SampleDocumentsLoader
ensureUniqueKey
-
-
-
-
Field Detail
-
CSV_MULTI_VALUE_DELIM_PARAM
public static final String CSV_MULTI_VALUE_DELIM_PARAM
- See Also:
- Constant Field Values
-
-
Method Detail
-
streamAsBytes
public static byte[] streamAsBytes(InputStream in) throws IOException
- Throws:
IOException
-
parseDocsFromStream
public SampleDocuments parseDocsFromStream(org.apache.solr.common.params.SolrParams params, org.apache.solr.common.util.ContentStream stream, int maxDocsToLoad) throws IOException
- Specified by:
parseDocsFromStream
in interfaceSampleDocumentsLoader
- Throws:
IOException
-
loadCsvDocs
protected List<org.apache.solr.common.SolrInputDocument> loadCsvDocs(org.apache.solr.common.params.SolrParams params, String source, byte[] streamBytes, String charset, int maxDocsToLoad) throws IOException
- Throws:
IOException
-
loadJsonLines
protected List<org.apache.solr.common.SolrInputDocument> loadJsonLines(org.apache.solr.common.params.SolrParams params, org.apache.solr.common.util.ContentStreamBase.ByteArrayStream stream, int maxDocsToLoad) throws IOException
- Throws:
IOException
-
loadJsonDocs
protected List<org.apache.solr.common.SolrInputDocument> loadJsonDocs(org.apache.solr.common.params.SolrParams params, org.apache.solr.common.util.ContentStreamBase.ByteArrayStream stream, int maxDocsToLoad) throws IOException
- Throws:
IOException
-
loadXmlDocs
protected List<org.apache.solr.common.SolrInputDocument> loadXmlDocs(org.apache.solr.common.params.SolrParams params, org.apache.solr.common.util.ContentStreamBase.ByteArrayStream stream, int maxDocsToLoad) throws IOException
- Throws:
IOException
-
parseXmlDocs
protected List<org.apache.solr.common.SolrInputDocument> parseXmlDocs(XMLStreamReader parser, int maxDocsToLoad) throws XMLStreamException
- Throws:
XMLStreamException
-
loadJsonLines
protected List<Map<String,Object>> loadJsonLines(String[] lines) throws IOException
- Throws:
IOException
-
readInputAsString
protected String readInputAsString(InputStream in) throws IOException
- Throws:
IOException
-
detectTSV
protected char detectTSV(String csvStr)
-
-