Package org.apache.solr.handler.loader
Class CSVLoaderBase
- java.lang.Object
-
- org.apache.solr.handler.loader.ContentStreamLoader
-
- org.apache.solr.handler.loader.CSVLoaderBase
-
public abstract class CSVLoaderBase extends ContentStreamLoader
-
-
Field Summary
Fields Modifier and Type Field Description static String
EMPTY
static String
ENCAPSULATOR
static String
ESCAPE
static String
FIELDNAMES
static String
HEADER
static String
LITERALS_PREFIX
static String
MAP
static String
OVERWRITE
protected UpdateRequestProcessor
processor
static String
ROW_ID
static String
ROW_ID_OFFSET
static String
SEPARATOR
static String
SKIP
static String
SKIPLINES
static String
SPLIT
protected AddUpdateCommand
templateAdd
static String
TRIM
-
Constructor Summary
Constructors Modifier Constructor Description protected
CSVLoaderBase(SolrQueryRequest req, UpdateRequestProcessor processor)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
addDoc(int line, String[] vals)
called for each line of values (document)protected void
doAdd(int line, String[] vals, org.apache.solr.common.SolrInputDocument doc, AddUpdateCommand template)
this must be MT safe...void
load(SolrQueryRequest req, SolrQueryResponse rsp, org.apache.solr.common.util.ContentStream stream, UpdateRequestProcessor processor)
load the CSV input-
Methods inherited from class org.apache.solr.handler.loader.ContentStreamLoader
getDefaultWT, init
-
-
-
-
Field Detail
-
SEPARATOR
public static final String SEPARATOR
- See Also:
- Constant Field Values
-
FIELDNAMES
public static final String FIELDNAMES
- See Also:
- Constant Field Values
-
HEADER
public static final String HEADER
- See Also:
- Constant Field Values
-
SKIP
public static final String SKIP
- See Also:
- Constant Field Values
-
SKIPLINES
public static final String SKIPLINES
- See Also:
- Constant Field Values
-
MAP
public static final String MAP
- See Also:
- Constant Field Values
-
TRIM
public static final String TRIM
- See Also:
- Constant Field Values
-
EMPTY
public static final String EMPTY
- See Also:
- Constant Field Values
-
SPLIT
public static final String SPLIT
- See Also:
- Constant Field Values
-
ENCAPSULATOR
public static final String ENCAPSULATOR
- See Also:
- Constant Field Values
-
ESCAPE
public static final String ESCAPE
- See Also:
- Constant Field Values
-
OVERWRITE
public static final String OVERWRITE
- See Also:
- Constant Field Values
-
LITERALS_PREFIX
public static final String LITERALS_PREFIX
- See Also:
- Constant Field Values
-
ROW_ID
public static final String ROW_ID
- See Also:
- Constant Field Values
-
ROW_ID_OFFSET
public static final String ROW_ID_OFFSET
- See Also:
- Constant Field Values
-
processor
protected final UpdateRequestProcessor processor
-
templateAdd
protected final AddUpdateCommand templateAdd
-
-
Constructor Detail
-
CSVLoaderBase
protected CSVLoaderBase(SolrQueryRequest req, UpdateRequestProcessor processor)
-
-
Method Detail
-
load
public void load(SolrQueryRequest req, SolrQueryResponse rsp, org.apache.solr.common.util.ContentStream stream, UpdateRequestProcessor processor) throws IOException
load the CSV input- Specified by:
load
in classContentStreamLoader
- Parameters:
req
- The inputSolrQueryRequest
rsp
- The response, in case the Loader wishes to add anythingstream
- TheContentStream
to addprocessor
- TheUpdateRequestProcessor
to use- Throws:
IOException
-
addDoc
public abstract void addDoc(int line, String[] vals) throws IOException
called for each line of values (document)- Throws:
IOException
-
doAdd
protected void doAdd(int line, String[] vals, org.apache.solr.common.SolrInputDocument doc, AddUpdateCommand template) throws IOException
this must be MT safe... may be called concurrently from multiple threads.- Throws:
IOException
-
-