mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-21 18:09:20 +00:00
Merged searchapi (5.2.1) to 5.2.N (5.2.1)
129779 gjames: SEARCH-118: Adding search.score to node response git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@130171 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -30,6 +30,7 @@ import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.rest.api.Nodes;
|
||||
import org.alfresco.rest.api.model.Node;
|
||||
import org.alfresco.rest.api.model.UserInfo;
|
||||
import org.alfresco.rest.api.search.model.SearchEntry;
|
||||
import org.alfresco.rest.framework.resource.parameters.CollectionWithPagingInfo;
|
||||
import org.alfresco.rest.framework.resource.parameters.Paging;
|
||||
import org.alfresco.rest.framework.resource.parameters.Params;
|
||||
@@ -78,8 +79,8 @@ public class ResultMapper
|
||||
results.forEach(row ->
|
||||
{
|
||||
Node aNode = nodes.getFolderOrDocument(row.getNodeRef(), null, null, params.getInclude(), null);
|
||||
//float f = row.getScore();
|
||||
//Long dbId = (Long) row.getValue(ContentModel.PROP_NODE_DBID);
|
||||
float f = row.getScore();
|
||||
aNode.setSearch(new SearchEntry(f));
|
||||
noderesults.add(aNode);
|
||||
}
|
||||
);
|
||||
|
@@ -0,0 +1,21 @@
|
||||
package org.alfresco.rest.api.search.model;
|
||||
|
||||
/**
|
||||
* POJO class representing the extra information that comes back from Search.
|
||||
**/
|
||||
public class SearchEntry
|
||||
{
|
||||
Float score;
|
||||
|
||||
public SearchEntry(Float score)
|
||||
{
|
||||
this.score = score;
|
||||
}
|
||||
|
||||
public Float getScore()
|
||||
{
|
||||
return score;
|
||||
}
|
||||
|
||||
//In future highlighting.
|
||||
}
|
Reference in New Issue
Block a user