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
-
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(SolrParams params, ContentStream stream, int maxDocsToLoad) throws IOException
- Specified by:
parseDocsFromStream
in interfaceSampleDocumentsLoader
- Throws:
IOException
-
loadCsvDocs
protected List<SolrInputDocument> loadCsvDocs(SolrParams params, String source, byte[] streamBytes, String charset, int maxDocsToLoad) throws IOException
- Throws:
IOException
-
loadJsonLines
protected List<SolrInputDocument> loadJsonLines(SolrParams params, ContentStreamBase.ByteArrayStream stream, int maxDocsToLoad) throws IOException
- Throws:
IOException
-
loadJsonDocs
protected List<SolrInputDocument> loadJsonDocs(SolrParams params, ContentStreamBase.ByteArrayStream stream, int maxDocsToLoad) throws IOException
- Throws:
IOException
-
loadXmlDocs
protected List<SolrInputDocument> loadXmlDocs(SolrParams params, ContentStreamBase.ByteArrayStream stream, int maxDocsToLoad) throws IOException
- Throws:
IOException
-
parseXmlDocs
protected List<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)
-
-