Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

REST API Response header parameter total-result-count is not counting all the matching entries #39

Closed
anakinj opened this issue Jun 4, 2019 · 2 comments
Assignees

Comments

@anakinj
Copy link

anakinj commented Jun 4, 2019

Hi,

Noticed a small issue with the Directory REST API related to the total-result-count not actually being what it advertises.

For example when using the UI and querying for the word "test" it says that there are around 3000 hits. https://test-directory.peppol.eu/public/locale-en_US/menuitem-search?q=test

But doing that same query using the API, the total is always just the size of the result set.
https://test-directory.peppol.eu/search/1.0/json?q=test&rpc=1
https://test-directory.peppol.eu/search/1.0/json?q=test&rpc=50

This makes it impossible to actually know when paging should be applied.

Think the API implementation needs to do a explicit count for the query, as the UI is doing here: https://github.com/phax/phoss-directory/blob/master/phoss-directory-publisher/src/main/java/com/helger/pd/publisher/app/pub/page/PagePublicSearchSimple.java#L162

@phax phax self-assigned this Jun 4, 2019
phax added a commit that referenced this issue Jun 4, 2019
phax added a commit that referenced this issue Jun 4, 2019
@phax
Copy link
Owner

phax commented Jun 4, 2019

Fixed in 0.8.0 release - thanks for pointing out. Will try to get it on the test server asap.

@phax phax closed this as completed Jun 4, 2019
@anakinj
Copy link
Author

anakinj commented Jun 5, 2019

Great! Thanks for the super-fast response.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants