mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
[ SEARCH-2166 ] Conflicts with master fixed
This commit is contained in:
-219
@@ -1904,223 +1904,4 @@ public class AlfrescoSolrDataModel implements QueryConstants
|
||||
diff.getElementName()))
|
||||
.collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds best completion fields in order of preference
|
||||
*/
|
||||
private void addCompletionFields(PropertyDefinition propertyDefinition, IndexedField indexedField)
|
||||
{
|
||||
if ((propertyDefinition.getIndexTokenisationMode() == IndexTokenisationMode.BOTH))
|
||||
{
|
||||
if(crossLocaleSearchDataTypes.contains(propertyDefinition.getDataType().getName()) || crossLocaleSearchProperties.contains(propertyDefinition.getName()))
|
||||
{
|
||||
indexedField.addField(getFieldForText(false, true, false, propertyDefinition), false, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
indexedField.addField(getFieldForText(true, true, false, propertyDefinition), false, false);
|
||||
}
|
||||
}
|
||||
else if ((propertyDefinition.getIndexTokenisationMode() == IndexTokenisationMode.TRUE))
|
||||
{
|
||||
if(crossLocaleSearchDataTypes.contains(propertyDefinition.getDataType().getName()) || crossLocaleSearchProperties.contains(propertyDefinition.getName()))
|
||||
{
|
||||
indexedField.addField(getFieldForText(false, true, false, propertyDefinition), false, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
indexedField.addField(getFieldForText(true, true, false, propertyDefinition), false, false);
|
||||
}
|
||||
}
|
||||
else if ((propertyDefinition.getIndexTokenisationMode() == IndexTokenisationMode.FALSE))
|
||||
{
|
||||
indexedField.addField(getFieldForText(false, false, false, propertyDefinition), false, false);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds best fts fields in order of preference
|
||||
*/
|
||||
|
||||
private void addFullTextSearchFields( PropertyDefinition propertyDefinition , IndexedField indexedField)
|
||||
{
|
||||
if (((propertyDefinition.getIndexTokenisationMode() == IndexTokenisationMode.TRUE)
|
||||
|| (propertyDefinition.getIndexTokenisationMode() == IndexTokenisationMode.BOTH))
|
||||
&& !isIdentifierTextProperty(propertyDefinition.getName()))
|
||||
{
|
||||
indexedField.addField(getFieldForText(true, true, false, propertyDefinition), true, false);
|
||||
if(crossLocaleSearchDataTypes.contains(propertyDefinition.getDataType().getName()) || crossLocaleSearchProperties.contains(propertyDefinition.getName()))
|
||||
{
|
||||
indexedField.addField(getFieldForText(false, true, false, propertyDefinition), false, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
indexedField.addField(getFieldForText(true, false, false, propertyDefinition), true, false);
|
||||
indexedField.addField(getFieldForText(false, false, false, propertyDefinition), false, false);
|
||||
}
|
||||
}
|
||||
|
||||
private void addHighlightSearchFields( PropertyDefinition propertyDefinition , IndexedField indexedField)
|
||||
{
|
||||
QName propertyName = propertyDefinition.getName();
|
||||
QName propertyDataTypeQName = propertyDefinition.getDataType().getName();
|
||||
String fieldName;
|
||||
|
||||
if(propertyDataTypeQName.equals(DataTypeDefinition.MLTEXT))
|
||||
{
|
||||
fieldName = getStoredMLTextField(propertyName);
|
||||
}
|
||||
else if(propertyDataTypeQName.equals(DataTypeDefinition.CONTENT))
|
||||
{
|
||||
fieldName = getStoredContentField(propertyName);
|
||||
}
|
||||
else
|
||||
{
|
||||
fieldName = getStoredTextField(propertyName);
|
||||
}
|
||||
|
||||
indexedField.addField(fieldName, false, false);
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds best identifier fields in order of preference
|
||||
*/
|
||||
private void addIdentifierSearchFields(PropertyDefinition propertyDefinition, IndexedField indexedField)
|
||||
{
|
||||
if ((propertyDefinition.getIndexTokenisationMode() == IndexTokenisationMode.FALSE)
|
||||
|| (propertyDefinition.getIndexTokenisationMode() == IndexTokenisationMode.BOTH))
|
||||
{
|
||||
|
||||
indexedField.addField(getFieldForText(true, false, false, propertyDefinition), true, false);
|
||||
indexedField.addField(getFieldForText(false, false, false, propertyDefinition), false, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
indexedField.addField(getFieldForText(true, true, false, propertyDefinition), true, false);
|
||||
if(crossLocaleSearchDataTypes.contains(propertyDefinition.getDataType().getName()) || crossLocaleSearchProperties.contains(propertyDefinition.getName()))
|
||||
{
|
||||
indexedField.addField(getFieldForText(false, true, false, propertyDefinition), false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Adds best identifier fields in order of preference
|
||||
*/
|
||||
private void addFacetSearchFields(PropertyDefinition propertyDefinition, IndexedField indexedField)
|
||||
{
|
||||
if(propertyDefinition.getDataType().getName().equals(DataTypeDefinition.TEXT))
|
||||
{
|
||||
if (!isIdentifierTextProperty(propertyDefinition.getName()))
|
||||
{
|
||||
if(propertyDefinition.getFacetable() == Facetable.TRUE)
|
||||
{
|
||||
indexedField.addField(getFieldForText(false, false, false, propertyDefinition), false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ((propertyDefinition.getIndexTokenisationMode() == IndexTokenisationMode.FALSE)
|
||||
|| (propertyDefinition.getIndexTokenisationMode() == IndexTokenisationMode.BOTH)
|
||||
|| isIdentifierTextProperty(propertyDefinition.getName()))
|
||||
{
|
||||
|
||||
indexedField.addField(getFieldForText(false, false, false, propertyDefinition), false, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(crossLocaleSearchDataTypes.contains(propertyDefinition.getDataType().getName()) || crossLocaleSearchProperties.contains(propertyDefinition.getName()))
|
||||
{
|
||||
indexedField.addField(getFieldForText(false, true, false, propertyDefinition), false, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
indexedField.addField(getFieldForText(true, true, false, propertyDefinition), false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addMultiSearchFields( PropertyDefinition propertyDefinition , IndexedField indexedField)
|
||||
{
|
||||
if ((propertyDefinition.getIndexTokenisationMode() == IndexTokenisationMode.FALSE)
|
||||
|| (propertyDefinition.getIndexTokenisationMode() == IndexTokenisationMode.BOTH)
|
||||
|| isIdentifierTextProperty(propertyDefinition.getName()))
|
||||
{
|
||||
|
||||
indexedField.addField(getFieldForText(false, false, false, propertyDefinition), false, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(crossLocaleSearchDataTypes.contains(propertyDefinition.getDataType().getName()) || crossLocaleSearchProperties.contains(propertyDefinition.getName()))
|
||||
{
|
||||
indexedField.addField(getFieldForText(false, true, false, propertyDefinition), false, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
indexedField.addField(getFieldForText(true, true, false, propertyDefinition), false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void addStatsSearchFields( PropertyDefinition propertyDefinition , IndexedField indexedField)
|
||||
{
|
||||
addFacetSearchFields(propertyDefinition, indexedField);
|
||||
}
|
||||
|
||||
private void addSortSearchFields( PropertyDefinition propertyDefinition , IndexedField indexedField)
|
||||
{
|
||||
// Can only order on single valued fields
|
||||
DataTypeDefinition dataTypeDefinition = propertyDefinition.getDataType();
|
||||
if(dataTypeDefinition.getName().equals(DataTypeDefinition.TEXT))
|
||||
{
|
||||
if(!propertyDefinition.isMultiValued())
|
||||
{
|
||||
if ((propertyDefinition.getIndexTokenisationMode() == IndexTokenisationMode.FALSE)
|
||||
|| (propertyDefinition.getIndexTokenisationMode() == IndexTokenisationMode.BOTH))
|
||||
{
|
||||
indexedField.addField(getFieldForText(false, false, true, propertyDefinition), false, true);
|
||||
}
|
||||
else if (isIdentifierTextProperty(propertyDefinition.getName()))
|
||||
{
|
||||
indexedField.addField(getFieldForText(false, false, false, propertyDefinition), false, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(crossLocaleSearchDataTypes.contains(propertyDefinition.getDataType().getName()) || crossLocaleSearchProperties.contains(propertyDefinition.getName()))
|
||||
{
|
||||
indexedField.addField(getFieldForText(false, true, false, propertyDefinition), false, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
indexedField.addField(getFieldForText(true, true, false, propertyDefinition), false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(dataTypeDefinition.getName().equals(DataTypeDefinition.MLTEXT))
|
||||
{
|
||||
if(!propertyDefinition.isMultiValued())
|
||||
{
|
||||
if ((propertyDefinition.getIndexTokenisationMode() == IndexTokenisationMode.FALSE)
|
||||
|| (propertyDefinition.getIndexTokenisationMode() == IndexTokenisationMode.BOTH))
|
||||
{
|
||||
indexedField.addField(getFieldForText(false, false, true, propertyDefinition), false, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(crossLocaleSearchDataTypes.contains(propertyDefinition.getDataType().getName()) || crossLocaleSearchProperties.contains(propertyDefinition.getName()))
|
||||
{
|
||||
indexedField.addField(getFieldForText(false, true, false, propertyDefinition), false, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
indexedField.addField(getFieldForText(true, true, false, propertyDefinition), false, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user