diff --git a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/SearchAFTSInFieldTest.java b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/SearchAFTSInFieldTest.java index 6fc22c2f3..92130b0d3 100644 --- a/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/SearchAFTSInFieldTest.java +++ b/e2e-test/src/test/java/org/alfresco/test/search/functional/searchServices/search/SearchAFTSInFieldTest.java @@ -137,13 +137,13 @@ public class SearchAFTSInFieldTest extends AbstractE2EFunctionalTest boolean fileFound = isContentInSearchResults(query, file2.getName(), true); Assert.assertTrue(fileFound, "File Not found for query: " + query); - testSearchQuery(query, 2, SearchLanguage.AFTS); + testSearchQuery(query, 1, SearchLanguage.AFTS); query = fieldName + ":'" + file2.getName() + "\'"; fileFound = isContentInSearchResults(query, file2.getName(), true); Assert.assertTrue(fileFound, "File Not found for query: " + query); - testSearchQuery(query, 2, SearchLanguage.AFTS); + testSearchQuery(query, 1, SearchLanguage.AFTS); }); } diff --git a/search-services/alfresco-search/generator-solr-config/generate-solr-config.py b/search-services/alfresco-search/generator-solr-config/generate-solr-config.py index 927385845..4c4ffffb4 100644 --- a/search-services/alfresco-search/generator-solr-config/generate-solr-config.py +++ b/search-services/alfresco-search/generator-solr-config/generate-solr-config.py @@ -66,10 +66,9 @@ def generate_fields(field_type, tokenized, string, cross_locale, sortable, sugge if string: generated_fields.append(get_copy_field_xml(field, create_non_tokenized(prefix))) + generated_fields.append(get_copy_field_xml(field, create_non_tokenized_cross_locale(prefix))) if sortable: generated_fields.append(get_copy_field_xml(field, create_sortable(prefix))) - if cross_locale: - generated_fields.append(get_copy_field_xml(field, create_non_tokenized_cross_locale(prefix))) if suggestable: generated_fields.append(get_copy_field_xml(field, "suggest")) @@ -107,7 +106,6 @@ def generate_text(file): file.write("\n") file.write("\n") - def main(): file = open(output_file, "w") file.write('\n') diff --git a/search-services/alfresco-search/pom.xml b/search-services/alfresco-search/pom.xml index 843e21555..fa2f0d4f9 100644 --- a/search-services/alfresco-search/pom.xml +++ b/search-services/alfresco-search/pom.xml @@ -280,6 +280,24 @@ src/main/resources/solr/instance + + conf/shared.properties + + + + + + + copy-test-conf + generate-test-resources + + copy-resources + + + ${project.build.testOutputDirectory}/test-files/conf + + + src/test/resources/test-files/conf diff --git a/search-services/alfresco-search/src/main/java/org/apache/solr/handler/component/AlfrescoSolrHighlighter.java b/search-services/alfresco-search/src/main/java/org/apache/solr/handler/component/AlfrescoSolrHighlighter.java index c8281991a..360de7842 100644 --- a/search-services/alfresco-search/src/main/java/org/apache/solr/handler/component/AlfrescoSolrHighlighter.java +++ b/search-services/alfresco-search/src/main/java/org/apache/solr/handler/component/AlfrescoSolrHighlighter.java @@ -189,14 +189,7 @@ public class AlfrescoSolrHighlighter extends DefaultSolrHighlighter implements P { schemaFieldName = AlfrescoSolrDataModel.getInstance().mapProperty(localFieldName, FieldUse.FTS, request, 1); } - - // In case after the second query we didn't get the cross-locale version, then it's better to ignore the - // fieldMatch parameter; in this way we are sure the snippets will be properly returned (together with other - // unwanted fields) - if (!schemaFieldName.contains("_t@{")) - { - schemaFieldName = null; - } + // The query scorer purpose is to give a score to the text fragments by the number of unique query terms found. // diff --git a/search-services/alfresco-search/src/main/resources/solr/instance/conf/shared.properties b/search-services/alfresco-search/src/main/resources/solr/instance/conf/shared.properties index 62dc5d66c..a80445145 100644 --- a/search-services/alfresco-search/src/main/resources/solr/instance/conf/shared.properties +++ b/search-services/alfresco-search/src/main/resources/solr/instance/conf/shared.properties @@ -16,19 +16,19 @@ alfresco.identifier.property.3={http://www.alfresco.org/model/content/1.0}author alfresco.identifier.property.4={http://www.alfresco.org/model/content/1.0}lockOwner # Suggestable Propeties -alfresco.suggestable.property.0={http://www.alfresco.org/model/content/1.0}name -alfresco.suggestable.property.1={http://www.alfresco.org/model/content/1.0}title -alfresco.suggestable.property.2={http://www.alfresco.org/model/content/1.0}description -alfresco.suggestable.property.3={http://www.alfresco.org/model/content/1.0}content +#alfresco.suggestable.property.0={http://www.alfresco.org/model/content/1.0}name +#alfresco.suggestable.property.1={http://www.alfresco.org/model/content/1.0}title +#alfresco.suggestable.property.2={http://www.alfresco.org/model/content/1.0}description +#alfresco.suggestable.property.3={http://www.alfresco.org/model/content/1.0}content # Data types that support cross locale/word splitting/token patterns if tokenised alfresco.cross.locale.property.0={http://www.alfresco.org/model/content/1.0}name alfresco.cross.locale.property.1={http://www.alfresco.org/model/content/1.0}lockOwner # Data types that support cross locale/word splitting/token patterns if tokenised -alfresco.cross.locale.datatype.0={http://www.alfresco.org/model/dictionary/1.0}text -alfresco.cross.locale.datatype.1={http://www.alfresco.org/model/dictionary/1.0}content -alfresco.cross.locale.datatype.2={http://www.alfresco.org/model/dictionary/1.0}mltext +#alfresco.cross.locale.datatype.0={http://www.alfresco.org/model/dictionary/1.0}text +#alfresco.cross.locale.datatype.1={http://www.alfresco.org/model/dictionary/1.0}content +#alfresco.cross.locale.datatype.2={http://www.alfresco.org/model/dictionary/1.0}mltext alfresco.model.tracker.cron=0/10 * * * * ? * diff --git a/search-services/alfresco-search/src/main/resources/solr/instance/templates/rerank/conf/generated_copy_fields.xml b/search-services/alfresco-search/src/main/resources/solr/instance/templates/rerank/conf/generated_copy_fields.xml index 7515129a5..7d743f35c 100644 --- a/search-services/alfresco-search/src/main/resources/solr/instance/templates/rerank/conf/generated_copy_fields.xml +++ b/search-services/alfresco-search/src/main/resources/solr/instance/templates/rerank/conf/generated_copy_fields.xml @@ -1,322 +1,346 @@ - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/search-services/alfresco-search/src/test/java/org/alfresco/solr/DynamicCopyFieldsIT.java b/search-services/alfresco-search/src/test/java/org/alfresco/solr/DynamicCopyFieldsIT.java index c72eb5e61..7b75204a0 100644 --- a/search-services/alfresco-search/src/test/java/org/alfresco/solr/DynamicCopyFieldsIT.java +++ b/search-services/alfresco-search/src/test/java/org/alfresco/solr/DynamicCopyFieldsIT.java @@ -295,7 +295,8 @@ public class DynamicCopyFieldsIT extends AbstractAlfrescoDistributedIT { .collect(Collectors.toSet()); Assert.assertEquals(Set.of(DynamicFieldType.STORED, DynamicFieldType.NON_TOKENIZED_LOCALE, - DynamicFieldType.TOKENIZED_LOCALE), dynamicFieldsTypes); + DynamicFieldType.TOKENIZED_LOCALE, + DynamicFieldType.NON_TOKENIZED_CROSS_LOCALE), dynamicFieldsTypes); } @@ -340,7 +341,8 @@ public class DynamicCopyFieldsIT extends AbstractAlfrescoDistributedIT { .collect(Collectors.toSet()); Assert.assertEquals(Set.of(DynamicFieldType.STORED, DynamicFieldType.NON_TOKENIZED_LOCALE, - DynamicFieldType.SORT), dynamicFieldsTypes); + DynamicFieldType.SORT, + DynamicFieldType.NON_TOKENIZED_CROSS_LOCALE), dynamicFieldsTypes); } @@ -361,7 +363,8 @@ public class DynamicCopyFieldsIT extends AbstractAlfrescoDistributedIT { Assert.assertEquals(Set.of(DynamicFieldType.STORED, DynamicFieldType.NON_TOKENIZED_LOCALE, DynamicFieldType.TOKENIZED_LOCALE, - DynamicFieldType.SORT), dynamicFieldsTypes); + DynamicFieldType.SORT, + DynamicFieldType.NON_TOKENIZED_CROSS_LOCALE), dynamicFieldsTypes); } @@ -424,7 +427,8 @@ public class DynamicCopyFieldsIT extends AbstractAlfrescoDistributedIT { Assert.assertEquals(Set.of(DynamicFieldType.STORED, DynamicFieldType.NON_TOKENIZED_LOCALE, - DynamicFieldType.SORT), dynamicFieldsTypes); + DynamicFieldType.SORT, + DynamicFieldType.NON_TOKENIZED_CROSS_LOCALE), dynamicFieldsTypes); } /** diff --git a/search-services/alfresco-search/src/test/resources/test-files/conf/shared.properties b/search-services/alfresco-search/src/test/resources/test-files/conf/shared.properties new file mode 100644 index 000000000..9c7acf8bb --- /dev/null +++ b/search-services/alfresco-search/src/test/resources/test-files/conf/shared.properties @@ -0,0 +1,36 @@ + +# Shared Properties file + +#Host details an external client would use to connect to Solr +solr.host=localhost +#If not set then solr.port will be the jetty.port +#solr.port=8983 +solr.baseurl=/solr + +# Properties treated as identifiers when indexed + +alfresco.identifier.property.0={http://www.alfresco.org/model/content/1.0}creator +alfresco.identifier.property.1={http://www.alfresco.org/model/content/1.0}modifier +alfresco.identifier.property.2={http://www.alfresco.org/model/content/1.0}userName +alfresco.identifier.property.3={http://www.alfresco.org/model/content/1.0}authorityName +alfresco.identifier.property.4={http://www.alfresco.org/model/content/1.0}lockOwner + +# Suggestable Propeties +alfresco.suggestable.property.0={http://www.alfresco.org/model/content/1.0}name +alfresco.suggestable.property.1={http://www.alfresco.org/model/content/1.0}title +alfresco.suggestable.property.2={http://www.alfresco.org/model/content/1.0}description +alfresco.suggestable.property.3={http://www.alfresco.org/model/content/1.0}content + +# Data types that support cross locale/word splitting/token patterns if tokenised +alfresco.cross.locale.property.0={http://www.alfresco.org/model/content/1.0}name +alfresco.cross.locale.property.1={http://www.alfresco.org/model/content/1.0}lockOwner + +# Data types that support cross locale/word splitting/token patterns if tokenised +alfresco.cross.locale.datatype.0={http://www.alfresco.org/model/dictionary/1.0}text +alfresco.cross.locale.datatype.1={http://www.alfresco.org/model/dictionary/1.0}content +alfresco.cross.locale.datatype.2={http://www.alfresco.org/model/dictionary/1.0}mltext + +alfresco.model.tracker.cron=0/10 * * * * ? * + +# Whether path queries are enabled. +alfresco.cascade.tracker.enabled=true