mirror of https://github.com/apache/lucene.git
SOLR-442 -- change indexDir to dataDir for FileFloatSource
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@606084 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ef5c818a43
commit
873bf03839
|
@ -38,13 +38,13 @@ public class FileFloatSource extends ValueSource {
|
|||
private final SchemaField keyField;
|
||||
private final float defVal;
|
||||
|
||||
private final String indexDir;
|
||||
private final String dataDir;
|
||||
|
||||
public FileFloatSource(SchemaField field, SchemaField keyField, float defVal, QParser parser) {
|
||||
this.field = field;
|
||||
this.keyField = keyField;
|
||||
this.defVal = defVal;
|
||||
this.indexDir = parser.getReq().getCore().getIndexDir();
|
||||
this.dataDir = parser.getReq().getCore().getDataDir();
|
||||
}
|
||||
|
||||
public String description() {
|
||||
|
@ -86,7 +86,7 @@ public class FileFloatSource extends ValueSource {
|
|||
return this.field.getName().equals(other.field.getName())
|
||||
&& this.keyField.getName().equals(other.keyField.getName())
|
||||
&& this.defVal == other.defVal
|
||||
&& this.indexDir.equals(other.indexDir);
|
||||
&& this.dataDir.equals(other.dataDir);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
|
@ -95,7 +95,7 @@ public class FileFloatSource extends ValueSource {
|
|||
|
||||
public String toString() {
|
||||
return "FileFloatSource(field="+field.getName()+",keyField="+keyField.getName()
|
||||
+ ",defVal="+defVal+",indexDir="+indexDir+")";
|
||||
+ ",defVal="+defVal+",dataDir="+dataDir+")";
|
||||
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ public class FileFloatSource extends ValueSource {
|
|||
InputStream is;
|
||||
String fname = "external_" + ffs.field.getName();
|
||||
try {
|
||||
is = getLatestFile(ffs.indexDir, fname);
|
||||
is = getLatestFile(ffs.dataDir, fname);
|
||||
} catch (IOException e) {
|
||||
// log, use defaults
|
||||
SolrCore.log.severe("Error opening external value source file: " +e);
|
||||
|
|
|
@ -52,7 +52,7 @@ public class TestFunctionQuery extends AbstractSolrTestCase {
|
|||
|
||||
String base = "external_foo_extf";
|
||||
void makeExternalFile(String field, String contents, String charset) {
|
||||
String dir = h.getCore().getIndexDir();
|
||||
String dir = h.getCore().getDataDir();
|
||||
String filename = dir + "/external_" + field + "." + System.currentTimeMillis();
|
||||
try {
|
||||
Writer out = new OutputStreamWriter(new FileOutputStream(filename), charset);
|
||||
|
|
Loading…
Reference in New Issue