mirror of https://github.com/apache/lucene.git
Fix for SOLR-2987 (numeric keys in external file field stopped processing the rest of the file)
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1229783 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ef4e44f30b
commit
7de1e259f1
|
@ -255,10 +255,9 @@ public class FileFloatSource extends ValueSource {
|
||||||
String key = line.substring(0, delimIndex);
|
String key = line.substring(0, delimIndex);
|
||||||
String val = line.substring(delimIndex+1, endIndex);
|
String val = line.substring(delimIndex+1, endIndex);
|
||||||
|
|
||||||
idType.readableToIndexed(key, internalKey);
|
|
||||||
|
|
||||||
float fval;
|
float fval;
|
||||||
try {
|
try {
|
||||||
|
idType.readableToIndexed(key, internalKey);
|
||||||
fval=Float.parseFloat(val);
|
fval=Float.parseFloat(val);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if (++otherErrors<=10) {
|
if (++otherErrors<=10) {
|
||||||
|
|
|
@ -273,7 +273,7 @@ valued. -->
|
||||||
stored="false" indexed="true"
|
stored="false" indexed="true"
|
||||||
class="solr.ExternalFileField" valType="float"/>
|
class="solr.ExternalFileField" valType="float"/>
|
||||||
|
|
||||||
<fieldType name="eff_tfloat" keyField="id" defVal="0"
|
<fieldType name="eff_tfloat" keyField="eff_ti" defVal="0"
|
||||||
stored="false" indexed="true"
|
stored="false" indexed="true"
|
||||||
class="solr.ExternalFileField" valType="tfloat"/>
|
class="solr.ExternalFileField" valType="tfloat"/>
|
||||||
|
|
||||||
|
@ -320,6 +320,8 @@ valued. -->
|
||||||
|
|
||||||
<field name="signatureField" type="string" indexed="true" stored="false"/>
|
<field name="signatureField" type="string" indexed="true" stored="false"/>
|
||||||
|
|
||||||
|
<field name="eff_trie" type="eff_tfloat" />
|
||||||
|
|
||||||
<!-- Dynamic field definitions. If a field name is not found, dynamicFields
|
<!-- Dynamic field definitions. If a field name is not found, dynamicFields
|
||||||
will be used if the name matches any of the patterns.
|
will be used if the name matches any of the patterns.
|
||||||
RESTRICTION: the glob-like pattern in the name attribute must have
|
RESTRICTION: the glob-like pattern in the name attribute must have
|
||||||
|
|
|
@ -295,6 +295,18 @@ public class TestFunctionQuery extends SolrTestCaseJ4 {
|
||||||
singleTest(extField,"\0",991,543210,992,-8,993,250);
|
singleTest(extField,"\0",991,543210,992,-8,993,250);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testExternalFileFieldNumericKey() throws Exception {
|
||||||
|
final String extField = "eff_trie";
|
||||||
|
final String keyField = "eff_ti";
|
||||||
|
assertU(adoc("id", "991", keyField, "91"));
|
||||||
|
assertU(adoc("id", "992", keyField, "92"));
|
||||||
|
assertU(adoc("id", "993", keyField, "93"));
|
||||||
|
assertU(commit());
|
||||||
|
makeExternalFile(extField, "91=543210\n92=-8\n93=250\n=67","UTF-8");
|
||||||
|
singleTest(extField,"\0",991,543210,992,-8,993,250);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGeneral() throws Exception {
|
public void testGeneral() throws Exception {
|
||||||
clearIndex();
|
clearIndex();
|
||||||
|
|
Loading…
Reference in New Issue