From 873bf0383976e853d11d19bbf48e1990af8c8be7 Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Fri, 21 Dec 2007 01:43:33 +0000 Subject: [PATCH] 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 --- .../apache/solr/search/function/FileFloatSource.java | 10 +++++----- .../apache/solr/search/function/TestFunctionQuery.java | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/java/org/apache/solr/search/function/FileFloatSource.java b/src/java/org/apache/solr/search/function/FileFloatSource.java index f8dbb70804c..410487a2e27 100755 --- a/src/java/org/apache/solr/search/function/FileFloatSource.java +++ b/src/java/org/apache/solr/search/function/FileFloatSource.java @@ -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); diff --git a/src/test/org/apache/solr/search/function/TestFunctionQuery.java b/src/test/org/apache/solr/search/function/TestFunctionQuery.java index 739f24b8cf5..daeea8b77c2 100755 --- a/src/test/org/apache/solr/search/function/TestFunctionQuery.java +++ b/src/test/org/apache/solr/search/function/TestFunctionQuery.java @@ -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);