Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

Please explain this plugin #10

Closed as not planned
Closed as not planned

Description

@silveltman

Hi there! I'm very confused, what is the purpose of this plugin?

Is it purely for searching in the admin ui?
is it also for creating a searchbar on the frontend?

Also, by default only the 'title' field is added, how would we set customs fields? The docs do not explain this.

And lastly, the search results collection on only populated when a doc is created or edited. Would this mean that if one were to add this plugin after there are already 200 docs created, those are not searchable untill they are edited?

Thanks in advance!

Activity

  1. jacobsfletch commented on Dec 13, 2023

    @jacobsfletch
    Member

    Hey @silveltman it looks like you've got a lot of support here 😄 Think of this plugin almost like an "Algolia Lite" so-to-speak in that you save static, minimal data for each document that can be used to serve up super fast responses in something like a search bar on your front-end. The results that are displayed in a search bar typically only need something like a title field, some metadata, the slug, etc. But this strategy also bypasses all of your potential afterRead hooks that may be present on your collection. So you can query these instead of your full documents, which may be a much more expensive operation to run based on your config. These records are also indexed in the db for further optimizations in the query itself.

    We'll definitely be improving the docs around this plugin, as well as all the others. RE: populating existing docs into the search, we ca write a utility function directly into this plugin that does this automatically when you click a button in the admin dashboard or something. That is a very good idea and easily doable.

  2. jacobsfletch commented on Dec 13, 2023

    @jacobsfletch
    Member

    This plugin is now being maintained in the Packages Directory of the Payload Monorepo. This repo will soon be archived and all open issues including this one will be closed. This issue has already been added to this open discussion, though, so that it will not get lost. Please refer to that discussion for more details and to continue the conversation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions