Giter Club home page Giter Club logo

Comments (8)

ankhuve avatar ankhuve commented on August 11, 2024 4

Allright, I read through the old issues and solved the pagination by doing this:

    $jobMatches = Searchy::search('jobs')
        ->fields('title', 'description')
        ->query($searchQuery)
        ->getQuery()
        ->having('relevance', '>', 10)
        ->skip($rowsToSkip)
        ->take($numPerPage)
        ->get();

Maybe someone with the same problem might find this helpful.

from laravel-searchy.

sml2h3 avatar sml2h3 commented on August 11, 2024 3

Searchy::qtn('title', 'name')
->query('d')
->getQuery()
->simplePaginate(2);

from laravel-searchy.

TomLingham avatar TomLingham commented on August 11, 2024 2

Great! Thanks. Leaving this one open for reference as it's been asked a few time 😄

from laravel-searchy.

Kolesar avatar Kolesar commented on August 11, 2024

I have many relations, so when searching I returned only ID, and after using 'standard' query with whereIn('id', ...)

I know it is slow, but I in this case pagination works, relations works, ... because I get standard Eloquent object

from laravel-searchy.

gags88 avatar gags88 commented on August 11, 2024

@ankhuve You can also use limit instead of take

from laravel-searchy.

gags88 avatar gags88 commented on August 11, 2024

@sml2h3 ... only simplePaginate works.. however, it would be wonderful if paginate method also works

from laravel-searchy.

wiedymi avatar wiedymi commented on August 11, 2024

i have the same issue

from laravel-searchy.

TomLingham avatar TomLingham commented on August 11, 2024

There are technical limitations that meant this can't easily be improved inside the library without blowing it out of it's original scope which is something that I don't want to do.

from laravel-searchy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.