AnsweredAssumed Answered

Alfresco slingshot search numberFound not equals to  totalRecords number

Question asked by soungalo on Jun 26, 2015
Hi

First sorry for my english.

I'm using Alfresco 5.0.d

I see in the search json result (with firebug console panel) that in addition to result items , 2 other properties are returned : numberFound and totalRecords . It seems that Alfresco default seach engine considers numberFound as total items found. So it display "numberFound results founded" to user.

The problem is that numberFound is not equals to totalRecords .

I see that totalRecords is the correct number of search result (in fact search always return "totalRecords" number of items).

So i decided to see in the webscript that performs search (alfresco-remote-api-5.0.d.jar\alfresco\templates\webscripts\org\alfresco\slingshot\search\search.lib.js). We can easly see that the "numberFound" property comes from this statment

var rs = search.queryResultSet(queryDef);
var numberFound  = rs.meta.numberFound ;

About "totalRecords" property, it comes from the same statement but a little bit different:

var totalRecords = rs.nodes.length which is the correct value of number of item really found.

So is it an Alfresco api bug ?

If no , is it possible that error comes from my query parameters ?

Can someone explains me what does mean the numberFound property ?

Thank you.

Outcomes