mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
Merge pull request #8 from Alfresco/feature/SEARCH-679
Feature/search 679
This commit is contained in:
+18
-4
@@ -1940,7 +1940,13 @@ public class AlfrescoSolrDataModel implements QueryConstants
|
||||
ContextAwareQuery contextAwareQuery = new ContextAwareQuery(luceneQuery, Boolean.TRUE.equals(isFilter) ? null : searchParameters);
|
||||
return contextAwareQuery;
|
||||
}
|
||||
|
||||
private PropertyDefinition getPropertyDefinition(String identifier)
|
||||
{
|
||||
return QueryParserUtils.matchPropertyDefinition(NamespaceService.CONTENT_MODEL_1_0_URI,
|
||||
getNamespaceDAO(),
|
||||
getDictionaryService(CMISStrictDictionaryService.DEFAULT),
|
||||
identifier);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param potentialProperty String
|
||||
@@ -1976,9 +1982,17 @@ public class AlfrescoSolrDataModel implements QueryConstants
|
||||
Pair<String, String> fieldNameAndEnding = QueryParserUtils.extractFieldNameAndEnding(potentialProperty);
|
||||
String luceneField = functionContext.getLuceneFieldName(fieldNameAndEnding.getFirst());
|
||||
|
||||
|
||||
PropertyDefinition propertyDef = QueryParserUtils.matchPropertyDefinition(NamespaceService.CONTENT_MODEL_1_0_URI, getNamespaceDAO(), getDictionaryService(CMISStrictDictionaryService.DEFAULT), fieldNameAndEnding.getFirst());
|
||||
|
||||
|
||||
PropertyDefinition propertyDef = getPropertyDefinition(fieldNameAndEnding.getFirst());
|
||||
//Retry scan using luceneField.
|
||||
if(propertyDef == null)
|
||||
{
|
||||
if(luceneField.contains("@"))
|
||||
{
|
||||
int index = luceneField.lastIndexOf("@");
|
||||
propertyDef = getPropertyDefinition(luceneField.substring(index +1));
|
||||
}
|
||||
}
|
||||
String solrSortField = null;
|
||||
if(propertyDef != null)
|
||||
{
|
||||
|
||||
+5
-1
@@ -1926,7 +1926,11 @@ public class AlfrescoFTSQParserPluginTest extends LoadAFTSTestData implements Qu
|
||||
null,
|
||||
16,
|
||||
new Integer[] { 3, 13, 4, 14, 11, 7, 8, 2, 10, 15, 5, 6, 16, 12, 9, 1 });
|
||||
|
||||
assertAQueryIsSorted("-eager or -dog",
|
||||
"cm_name desc",
|
||||
null,
|
||||
16,
|
||||
new Integer[] { 3, 13, 4, 14, 11, 7, 8, 2, 10, 15, 5, 6, 16, 12, 9, 1 });
|
||||
assertAQueryIsSorted("-eager or -dog",
|
||||
"@name asc",
|
||||
null,
|
||||
|
||||
Reference in New Issue
Block a user