mirror of
https://github.com/Alfresco/SearchServices.git
synced 2026-09-16 18:12:56 +00:00
[SEARCH-2143]
removed aclId from the documentId
This commit is contained in:
+2
-3
@@ -342,13 +342,12 @@ public class AlfrescoSolrDataModel implements QueryConstants
|
||||
* Returns the Solr document identifier in the following format <TENANT>!<ACLID>!<DBID>
|
||||
*
|
||||
* @param tenant the tenant code.
|
||||
* @param aclId the ACL identifier.
|
||||
* @param dbid the DB identifier.
|
||||
* @return the Solr document identifier in the following format <TENANT>!<ACLID>!<DBID>
|
||||
*/
|
||||
public static String getNodeDocumentId(String tenant, Long aclId, Long dbid)
|
||||
public static String getNodeDocumentId(String tenant, Long dbid)
|
||||
{
|
||||
return getTenantId(tenant) + "!" + NumericEncoder.encode(aclId) + "!" + NumericEncoder.encode(dbid);
|
||||
return getTenantId(tenant) + "!" + NumericEncoder.encode(dbid);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-3
@@ -1845,7 +1845,6 @@ public class SolrInformationServer implements InformationServer
|
||||
doc.setField(FIELD_SOLR4_ID,
|
||||
AlfrescoSolrDataModel.getNodeDocumentId(
|
||||
docRef.tenant,
|
||||
docRef.aclId,
|
||||
docRef.dbId));
|
||||
|
||||
if (docRef.optionalBag.containsKey(CONTENT_LOCALE_FIELD))
|
||||
@@ -2797,7 +2796,7 @@ public class SolrInformationServer implements InformationServer
|
||||
FieldInstance fieldInstance = fieldInstances.get(0);
|
||||
AddUpdateCommand cmd = new AddUpdateCommand(request);
|
||||
SolrInputDocument input = new SolrInputDocument();
|
||||
input.addField(FIELD_SOLR4_ID, AlfrescoSolrDataModel.getNodeDocumentId(nodeMetaData.getTenantDomain(), nodeMetaData.getAclId(), nodeMetaData.getId()));
|
||||
input.addField(FIELD_SOLR4_ID, AlfrescoSolrDataModel.getNodeDocumentId(nodeMetaData.getTenantDomain(), nodeMetaData.getId()));
|
||||
input.addField(FIELD_VERSION, 0);
|
||||
input.addField(fieldInstance.getField(), stringPropertyValue.getValue());
|
||||
cmd.solrDoc = input;
|
||||
@@ -3245,7 +3244,6 @@ public class SolrInformationServer implements InformationServer
|
||||
doc.setField(FIELD_SOLR4_ID,
|
||||
AlfrescoSolrDataModel.getNodeDocumentId(
|
||||
metadata.getTenantDomain(),
|
||||
metadata.getAclId(),
|
||||
metadata.getId()));
|
||||
doc.setField(FIELD_VERSION, 0);
|
||||
|
||||
|
||||
+1
-1
@@ -531,7 +531,7 @@ public class AlfrescoSolrUtils
|
||||
NodeRef[] ancestors)throws IOException
|
||||
{
|
||||
SolrInputDocument doc = new SolrInputDocument();
|
||||
String id = AlfrescoSolrDataModel.getNodeDocumentId(AlfrescoSolrDataModel.DEFAULT_TENANT, aclId, dbid);
|
||||
String id = AlfrescoSolrDataModel.getNodeDocumentId(AlfrescoSolrDataModel.DEFAULT_TENANT, dbid);
|
||||
doc.addField(FIELD_SOLR4_ID, id);
|
||||
doc.addField(FIELD_VERSION, 0);
|
||||
doc.addField(FIELD_DBID, "" + dbid);
|
||||
|
||||
+1
-1
@@ -48,7 +48,7 @@ public class SolrDataModelTest
|
||||
String tenant = "TheTenant";
|
||||
Long aclId = 987698769860l;
|
||||
Long dbId = 9879987l;
|
||||
String id = AlfrescoSolrDataModel.getNodeDocumentId(tenant, aclId, dbId);
|
||||
String id = AlfrescoSolrDataModel.getNodeDocumentId(tenant, dbId);
|
||||
TenantAclIdDbId ids = AlfrescoSolrDataModel.decodeNodeDocumentId(id);
|
||||
assertEquals(tenant,ids.tenant);
|
||||
assertEquals(aclId, ids.aclId);
|
||||
|
||||
+1
-1
@@ -328,7 +328,7 @@ public class AFTSRequestHandlerIT extends AbstractRequestHandlerIT implements Qu
|
||||
public void idField()
|
||||
{
|
||||
range(1, 16)
|
||||
.mapToObj(dbId -> escape(AlfrescoSolrDataModel.getNodeDocumentId(AlfrescoSolrDataModel.DEFAULT_TENANT, 1L, dbId)))
|
||||
.mapToObj(dbId -> escape(AlfrescoSolrDataModel.getNodeDocumentId(AlfrescoSolrDataModel.DEFAULT_TENANT, dbId)))
|
||||
.forEach(id -> assertResponseCardinality(FIELD_SOLR4_ID, id, 1));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user