Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Is it possible to get the number of results that will be returned by a certain query? #12

Open
sergejsrk opened this issue Nov 10, 2022 · 1 comment

Comments

@sergejsrk
Copy link

Hello!

Let us say that I want to find all Cities.
To do it I run the following query:
https://lookup.dbpedia.org/api/search?typeNameRequired=true&query=City

This query returns only 100 results.
Then I can add max results parameter with some approximate value to the original query and run the query again:
https://lookup.dbpedia.org/api/search?typeNameRequired=true&query=City&maxResults=200

I can see that num of returned results is equal to maxResults value.
Then I can run one more query with the value of maxResults increased.

So this way I certainly can find the num of results in the response.

But I was wondering if maybe there is another way to do it?
Maybe something similar to getting count and then iterating with limit and offset ...

Thanks in advance!

@holycrab13
Copy link
Contributor

I added this as a feature on the current refactor branch which will replace the main branch soon. Once that is done, I will update the dbpedia lookup with this.

Usage will be &maxResults=0 which will then return no documents but a count of the results instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants