mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Search API updates. FTS fixes for range and dual tokenisation.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14419 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -30,6 +30,7 @@ import java.util.Collection;
|
||||
import org.alfresco.cmis.CMISDictionaryModel;
|
||||
import org.alfresco.cmis.CMISQueryException;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.search.impl.lucene.AnalysisMode;
|
||||
import org.alfresco.repo.search.impl.lucene.LuceneQueryParser;
|
||||
import org.alfresco.repo.search.impl.querymodel.PredicateMode;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
@@ -104,7 +105,7 @@ public class ObjectIdProperty extends AbstractProperty
|
||||
{
|
||||
String field = getLuceneFieldName();
|
||||
String stringValue = getValueAsString(value);
|
||||
return lqp.getFieldQuery(field, stringValue);
|
||||
return lqp.getFieldQuery(field, stringValue, AnalysisMode.IDENTIFIER);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -171,11 +172,11 @@ public class ObjectIdProperty extends AbstractProperty
|
||||
String value = asStrings.iterator().next();
|
||||
if (not)
|
||||
{
|
||||
return lqp.getDoesNotMatchFieldQuery(field, value);
|
||||
return lqp.getDoesNotMatchFieldQuery(field, value, AnalysisMode.IDENTIFIER);
|
||||
}
|
||||
else
|
||||
{
|
||||
return lqp.getFieldQuery(field, value);
|
||||
return lqp.getFieldQuery(field, value, AnalysisMode.IDENTIFIER);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -187,7 +188,7 @@ public class ObjectIdProperty extends AbstractProperty
|
||||
}
|
||||
for (String value : asStrings)
|
||||
{
|
||||
Query any = lqp.getFieldQuery(field, value);
|
||||
Query any = lqp.getFieldQuery(field, value, AnalysisMode.IDENTIFIER);
|
||||
if (not)
|
||||
{
|
||||
booleanQuery.add(any, Occur.MUST_NOT);
|
||||
@@ -209,7 +210,7 @@ public class ObjectIdProperty extends AbstractProperty
|
||||
{
|
||||
String field = getLuceneFieldName();
|
||||
String stringValue = getValueAsString(value);
|
||||
return lqp.getDoesNotMatchFieldQuery(field, stringValue);
|
||||
return lqp.getDoesNotMatchFieldQuery(field, stringValue, AnalysisMode.IDENTIFIER);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -245,12 +246,12 @@ public class ObjectIdProperty extends AbstractProperty
|
||||
{
|
||||
BooleanQuery booleanQuery = new BooleanQuery();
|
||||
booleanQuery.add(new MatchAllDocsQuery(), Occur.MUST);
|
||||
booleanQuery.add(lqp.getLikeQuery(field, stringValue), Occur.MUST_NOT);
|
||||
booleanQuery.add(lqp.getLikeQuery(field, stringValue, AnalysisMode.IDENTIFIER), Occur.MUST_NOT);
|
||||
return booleanQuery;
|
||||
}
|
||||
else
|
||||
{
|
||||
return lqp.getLikeQuery(field, stringValue);
|
||||
return lqp.getLikeQuery(field, stringValue, AnalysisMode.IDENTIFIER);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user