mirror of https://github.com/apache/lucene.git
The CSV loader incorrectly threw an exception when given header=true
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@600419 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c3f80c5004
commit
b627573cba
|
@ -217,6 +217,10 @@ Bug Fixes
|
|||
13. SOLR-413: Requesting a large numbers of documents to be returned (limit)
|
||||
can result in an out-of-memory exception, even for a small index. (yonik)
|
||||
|
||||
14. The CSV loader incorrectly threw an exception when given
|
||||
header=true (the default). (ryan, yonik)
|
||||
|
||||
|
||||
Other Changes
|
||||
1. SOLR-135: Moved common classes to org.apache.solr.common and altered the
|
||||
build scripts to make two jars: apache-solr-1.3.jar and
|
||||
|
|
|
@ -240,7 +240,7 @@ abstract class CSVLoader {
|
|||
if (null == hasHeader) {
|
||||
// assume the file has the headers if they aren't supplied in the args
|
||||
hasHeader=true;
|
||||
} else if (hasHeader) {
|
||||
} else if (!hasHeader) {
|
||||
throw new SolrException( SolrException.ErrorCode.BAD_REQUEST,"CSVLoader: must specify fieldnames=<fields>* or header=true");
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -123,6 +123,10 @@ public class TestCSVLoader extends AbstractSolrTestCase {
|
|||
loadLocal("stream.file",filename, "commit","true");
|
||||
assertQ(req("id:[100 TO 110]"),"//*[@numFound='4']");
|
||||
|
||||
// test explicitly adding header=true (the default)
|
||||
loadLocal("stream.file",filename, "commit","true","header","true");
|
||||
assertQ(req("id:[100 TO 110]"),"//*[@numFound='4']");
|
||||
|
||||
// test no overwrites
|
||||
loadLocal("stream.file",filename, "commit","true", "overwrite","false");
|
||||
assertQ(req("id:[100 TO 110]"),"//*[@numFound='8']");
|
||||
|
|
Loading…
Reference in New Issue