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

searching from multiple inputs as filters on nested JSON [Question] #49

Description

@Jamanya

#how would i implement this if i needed to have multiple inputs (6 of them) as search filters that needed to be inclusive , ie.. if i search for a name, AND state, AND topic, it would return the results that match all the filters.

multiple filters seem to work if the json object is FLAT. and from one search box, my use case is having multiple input boxes and a heavily nested object.

Activity

  1. aVolpe commented on Apr 17, 2020

    @aVolpe
    Collaborator

    I think this is a complex case that is out of scope of this library, however, you can use the code to create a custom filter.

    A trick that I use when i encoutner this kind of problem is to add a new field en the object "searchField" that is the concatenation of the search fields, for eaxmple:

        const data = [...].map(d => ({ ...d, searchField: `${d.name}-${d.state}-${d.parent.children}` });
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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions