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:
Ryan McKinley 2007-12-21 01:43:33 +00:00
parent ef5c818a43
commit 873bf03839
2 changed files with 6 additions and 6 deletions

View File

@ -38,13 +38,13 @@ public class FileFloatSource extends ValueSource {
private final SchemaField keyField; private final SchemaField keyField;
private final float defVal; private final float defVal;
private final String indexDir; private final String dataDir;
public FileFloatSource(SchemaField field, SchemaField keyField, float defVal, QParser parser) { public FileFloatSource(SchemaField field, SchemaField keyField, float defVal, QParser parser) {
this.field = field; this.field = field;
this.keyField = keyField; this.keyField = keyField;
this.defVal = defVal; this.defVal = defVal;
this.indexDir = parser.getReq().getCore().getIndexDir(); this.dataDir = parser.getReq().getCore().getDataDir();
} }
public String description() { public String description() {
@ -86,7 +86,7 @@ public class FileFloatSource extends ValueSource {
return this.field.getName().equals(other.field.getName()) return this.field.getName().equals(other.field.getName())
&& this.keyField.getName().equals(other.keyField.getName()) && this.keyField.getName().equals(other.keyField.getName())
&& this.defVal == other.defVal && this.defVal == other.defVal
&& this.indexDir.equals(other.indexDir); && this.dataDir.equals(other.dataDir);
} }
public int hashCode() { public int hashCode() {
@ -95,7 +95,7 @@ public class FileFloatSource extends ValueSource {
public String toString() { public String toString() {
return "FileFloatSource(field="+field.getName()+",keyField="+keyField.getName() 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; InputStream is;
String fname = "external_" + ffs.field.getName(); String fname = "external_" + ffs.field.getName();
try { try {
is = getLatestFile(ffs.indexDir, fname); is = getLatestFile(ffs.dataDir, fname);
} catch (IOException e) { } catch (IOException e) {
// log, use defaults // log, use defaults
SolrCore.log.severe("Error opening external value source file: " +e); SolrCore.log.severe("Error opening external value source file: " +e);

View File

@ -52,7 +52,7 @@ public class TestFunctionQuery extends AbstractSolrTestCase {
String base = "external_foo_extf"; String base = "external_foo_extf";
void makeExternalFile(String field, String contents, String charset) { 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(); String filename = dir + "/external_" + field + "." + System.currentTimeMillis();
try { try {
Writer out = new OutputStreamWriter(new FileOutputStream(filename), charset); Writer out = new OutputStreamWriter(new FileOutputStream(filename), charset);