Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

searching functionality with graphql

default discord avatar
bhavikaklast year
9

hello is it possible to implement searching functionality with graphql.

  • discord user avatar
    denolfe
    last year

    Yes, the "plural" version of the collections can accept a where clause like this:

    image.png
  • default discord avatar
    bhavikaklast year

    but it's like an filter. i get all pages title that include abc keyword in title.

  • discord user avatar
    denolfe
    last year

    That is not the behavior that I'm seeing



    Here is if I modify the above query

    CleanShot_2023-04-24_at_09.54.21.png
  • default discord avatar
    bhavikaklast year

    okay @denolfe it means i have to choose another way right?

  • discord user avatar
    denolfe
    last year

    No, you were claiming that you were getting "all pages title that include abc keyword", and I showed you that

    equals

    searches the field in its entirety



    The

    like

    keyword instead of

    equals

    can be used for partial searches.

  • default discord avatar
    bhavikaklast year

    it's working 🤘



    thanks a lot @denolfe for the help.

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.