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

Incorrect number of results returned when using offset and length attributes #220

Open
dniccum opened this issue Jan 10, 2020 · 4 comments
Labels

Comments

@dniccum
Copy link

dniccum commented Jan 10, 2020

I am currently encountering an issue where the incorrect number of results are being returned. Using the code below, I am requesting 20 results to be returned. However after several different attempts, it appears that Algolia is only returning 19 results.

\App\Configuration::search('jersey')
            ->where('created_by', 25)
            ->with([
                'offset' => 20,
                'length' => 20,
            ])
            ->get()

I have also used the following code with the same result:

\App\Configuration::search('jersey')
            ->where('created_by', 25)
            ->with([
                'hitsPerPage' => 20
            ])
            ->get()
@sarabisohrab
Copy link

Hi there.
I am a beginner and I wondered if I can do anything about this problem.
Can you explain a little about the error place in the code?

@nunomaduro
Copy link
Contributor

@sarabisohrab Thanks for trying to help! Let's wait for @dniccum feedback. Let me know if you need any help!

@sarabisohrab
Copy link

@sarabisohrab Thanks for trying to help! Let's wait for @dniccum feedback. Let me know if you need any help!
Thanks a lot. I'll be happy if I can do even a little thing about this.

@dniccum
Copy link
Author

dniccum commented Jan 13, 2020

@sarabisohrab The error in question is the fact that I am requesting 20 results from Algolia and only receiving 19 as I indicated in the original post; using 'length' => 20 and 'hitsPerPage' => 20 (which is essentially the same thing).

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

No branches or pull requests

3 participants