Search api hides documents when offset is used
I use next api: https://developer.box.com/guides/search/
When I do a "paged" search by something and user switch the page he quite regular catch that some documents are missed which are on an edge of a page.
Here is an example with page size = 10:
client.search.query(
'sub',
{
fields: 'name,metadata.enterprise.XXXXXXX',
ancestor_folder_ids: XXXXXXXX,
limit: 10,
offset: 10 * page,
mdfilters: [
{
scope: 'enterprise',
templateKey: 'XXXXX',
filters: {}
}
]
});
};
The result of calling the api three times (page 0, 1 and 2):
'sub folder test file 00147.txt',
'sub folder test file 00129.txt',
'sub folder test file 00124.txt',
'sub folder test file 00111.txt',
'sub folder test file 00096.txt',
'sub folder test file 00080.txt',
'sub folder test file 00076.txt',
'sub folder test file 00072.txt',
'sub folder test file 00066.txt',
'sub folder test file 00056.txt',
'sub folder test file 00055.txt',
'sub folder test file 00031.txt',
'sub folder test file 00027.txt',
'sub folder test file 00011.txt',
'sub folder test file 00009.txt',
'sub folder test file 00004.txt',
'sub folder test file 00146.txt',
'sub folder test file 00141.txt',
'sub folder test file 00137.txt',
'sub folder test file 00104.txt', <<<
'sub folder test file 00104.txt', <<<
'sub folder test file 00090.txt',
'sub folder test file 00068.txt',
'sub folder test file 00075.txt',
'sub folder test file 00077.txt',
'sub folder test file 00063.txt',
'sub folder test file 00061.txt',
'sub folder test file 00060.txt',
'sub folder test file 00052.txt',
'sub folder test file 00051.txt'
Document 'sub folder test file 00104.txt' appeared twice (first time as the last document on a second page, third time as a first document on a third page) and 'sub folder test file 00108.txt' is missed.
Post is closed for comments.
Comments
0 comments