Merge pull request #1081 from Alfresco/fix/MNT-22045_minhash_update

[MNT-22045] Prevents MINHASH field from being always added

(cherry picked from commit 0830476021049c9e9bb8c3b3e9881937eb726bda)
This commit is contained in:
tiagosalvado10
2021-02-03 22:25:10 +00:00
committed by Tiago Salvado
parent d42767866f
commit 1ae7195791
2 changed files with 8 additions and 6 deletions

View File

@@ -190,7 +190,7 @@ public class FingerPrintTest extends AbstractE2EFunctionalTest
testSearchQueryUnordered(fingerprintQuery, expectedNames, SearchLanguage.AFTS);
}
@Test(priority = 5, enabled = false)
@Test(priority = 5)
@Bug(id = "SEARCH-2065")
public void searchAfterVersionUpdate()
{
@@ -215,13 +215,13 @@ public class FingerPrintTest extends AbstractE2EFunctionalTest
Assert.assertTrue(found, "Update File Not found in results for Fingerprint Query with updated content");
}
@Test(priority = 6, enabled = false)
@Test(priority = 6)
@Bug(id = "SEARCH-2065")
public void searchAfterVersionRevert() throws Exception
{
// Revert fileToBeUpdated to previous version
restClient.authenticateUser(testUser).withCoreAPI().usingNode(fileToBeUpdated).revertVersion("1.0", "{}");
String revertedContent = restClient.authenticateUser(testUser).withCoreAPI().usingNode(fileToBeUpdated).getVersionContent("1.2").toString();
String revertedContent = restClient.authenticateUser(testUser).withCoreAPI().usingNode(fileToBeUpdated).getVersionContent("1.2").getResponse().asString();
Assert.assertEquals(revertedContent, fileOriginal.getContent(), "Reverted content does not match Original");
// Wair for the new version of the file to be indexed
@@ -236,7 +236,7 @@ public class FingerPrintTest extends AbstractE2EFunctionalTest
Assert.assertTrue(notFound, "File appears in the results for Fingerprint Query even after reverting content changes");
}
@Test(priority = 7, enabled = false)
@Test(priority = 7)
@Bug(id = "SEARCH-2065")
public void searchAfterVersionDelete() throws Exception
{

View File

@@ -2749,7 +2749,9 @@ public class SolrInformationServer implements InformationServer
TokenStream ts = analyzer.tokenStream("dummy_field", textContent);
CharTermAttribute termAttribute = ts.getAttribute(CharTermAttribute.class);
ts.reset();
while (ts.incrementToken()) {
doc.removeField(FINGERPRINT_FIELD);
while (ts.incrementToken())
{
StringBuilder tokenBuff = new StringBuilder();
char[] buff = termAttribute.buffer();
@@ -4102,4 +4104,4 @@ public class SolrInformationServer implements InformationServer
return empty();
}
}
}
}