mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
Fixed unreported bug when doing Lucene search across all attributes on types that contain numeric properties
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3123 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -48,6 +48,8 @@ public class DoubleTokenFilter extends Tokenizer
|
||||
{
|
||||
Token candidate;
|
||||
while((candidate = baseTokeniser.next()) != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
Double d = Double.valueOf(candidate.termText());
|
||||
String valueString = NumericEncoder.encode(d.doubleValue());
|
||||
@@ -55,6 +57,11 @@ public class DoubleTokenFilter extends Tokenizer
|
||||
candidate.type());
|
||||
return doubleToken;
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
// just ignore and try the next one
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -48,6 +48,8 @@ public class FloatTokenFilter extends Tokenizer
|
||||
{
|
||||
Token candidate;
|
||||
while((candidate = baseTokeniser.next()) != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
Float floatValue = Float.valueOf(candidate.termText());
|
||||
String valueString = NumericEncoder.encode(floatValue.floatValue());
|
||||
@@ -55,6 +57,11 @@ public class FloatTokenFilter extends Tokenizer
|
||||
candidate.type());
|
||||
return floatToken;
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
// just ignore and try the next one
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -48,6 +48,8 @@ public class IntegerTokenFilter extends Tokenizer
|
||||
{
|
||||
Token candidate;
|
||||
while((candidate = baseTokeniser.next()) != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
Integer integer = Integer.valueOf(candidate.termText());
|
||||
String valueString = NumericEncoder.encode(integer.intValue());
|
||||
@@ -55,6 +57,11 @@ public class IntegerTokenFilter extends Tokenizer
|
||||
candidate.type());
|
||||
return integerToken;
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
// just ignore and try the next one
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -19,6 +19,7 @@ package org.alfresco.repo.search.impl.lucene.analysis;
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.apache.lucene.analysis.Token;
|
||||
import org.apache.lucene.analysis.Tokenizer;
|
||||
import org.apache.lucene.analysis.standard.StandardTokenizer;
|
||||
@@ -48,6 +49,8 @@ public class LongTokenFilter extends Tokenizer
|
||||
{
|
||||
Token candidate;
|
||||
while((candidate = baseTokeniser.next()) != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
Long longValue = Long.valueOf(candidate.termText());
|
||||
String valueString = NumericEncoder.encode(longValue.longValue());
|
||||
@@ -55,6 +58,11 @@ public class LongTokenFilter extends Tokenizer
|
||||
candidate.type());
|
||||
return longToken;
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
// just ignore and try the next one
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user