mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
Added unit test to replicate the issue
This commit is contained in:
@@ -126,6 +126,18 @@
|
||||
<facetable>true</facetable>
|
||||
</index>
|
||||
</property>
|
||||
<property name="allfieldtypes:multiplemltext">
|
||||
<title>mltextMultiple</title>
|
||||
<type>d:mltext</type>
|
||||
<mandatory>false</mandatory>
|
||||
<multiple>true</multiple>
|
||||
<index enabled="true">
|
||||
<atomic>true</atomic>
|
||||
<stored>false</stored>
|
||||
<tokenised>both</tokenised>
|
||||
<facetable>true</facetable>
|
||||
</index>
|
||||
</property>
|
||||
<property name="allfieldtypes:textPatternMany">
|
||||
<title>textPatternMany</title>
|
||||
<type>d:text</type>
|
||||
|
||||
+27
-1
@@ -26,6 +26,9 @@
|
||||
|
||||
package org.alfresco.test.search.functional.searchServices.search;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.rest.search.SearchResponse;
|
||||
import org.alfresco.utility.data.CustomObjectTypeProperties;
|
||||
import org.alfresco.utility.model.FileModel;
|
||||
@@ -61,11 +64,17 @@ public class FieldDefinitionTest extends AbstractSearchServicesE2ETest {
|
||||
|
||||
dataContent.usingUser(testUser).usingSite(testSite).createCustomContent(File2, "cmis:document", new CustomObjectTypeProperties());
|
||||
|
||||
List<String> mlMultipleValue = new ArrayList<String>();
|
||||
mlMultipleValue.add("oranges");
|
||||
mlMultipleValue.add("apples");
|
||||
mlMultipleValue.add("pears");
|
||||
|
||||
cmisApi.authenticateUser(testUser).usingResource(File2).addSecondaryTypes("P:allfieldtypes:text")
|
||||
.updateProperty("allfieldtypes:textFree", "text field definition test")
|
||||
.updateProperty("allfieldtypes:textPatternMany", "mltext field definition test")
|
||||
.updateProperty("allfieldtypes:textLOVWhole", "text field not tokenised")
|
||||
.updateProperty("allfieldtypes:mltextLOVWhole", "mltext field not tokenised");
|
||||
.updateProperty("allfieldtypes:mltextLOVWhole", "mltext field not tokenised")
|
||||
.updateProperty("allfieldtypes:multiplemltext", mlMultipleValue);
|
||||
|
||||
waitForMetadataIndexing(File1.getName(), true);
|
||||
waitForMetadataIndexing(File2.getName(), true);
|
||||
@@ -198,4 +207,21 @@ public class FieldDefinitionTest extends AbstractSearchServicesE2ETest {
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
Assert.assertEquals(response.getPagination().getCount(), 0);
|
||||
}
|
||||
|
||||
// A test to test the multiple mltext field in the solr schema
|
||||
@Test(priority = 8)
|
||||
public void testmlTextFieldMuliple()
|
||||
{
|
||||
SearchResponse response = queryAsUser(testUser, "allfieldtypes_multiplemltext:\"oranges\"");
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
Assert.assertEquals(response.getPagination().getCount(), 1);
|
||||
|
||||
response = queryAsUser(testUser, "allfieldtypes_multiplemltext:\"apple\"");
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
Assert.assertEquals(response.getPagination().getCount(), 0);
|
||||
|
||||
response = queryAsUser(testUser, "allfieldtypes_multiplemltext:\"pear\"");
|
||||
restClient.assertStatusCodeIs(HttpStatus.OK);
|
||||
Assert.assertEquals(response.getPagination().getCount(), 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user