[FEATURE] - Add support for an Advanced Search
malaney opened this issue · 3 comments
Summary
Currently next-admin supports searching against a single string input across numerous fields, which is great. But often times our admin panels require search across multiple conditions with multiple data types. For example:
const result = await prisma.post.findMany({
where: {
AND: [
{
content: {
contains: 'Prisma',
},
},
{
published: {
equals: false,
},
},
],
},
})
Could we add support for an Advanced Search that allows users to define search fields (i.e. "content" and "published") as well as data types (i.e. "string" and "boolean") and perhaps even a comparator (i.e. lt, gt, lte, gte, etc ...).
Thank you for considering this. Next-Admin is outstanding!!
Basic Example
As a user I'd like to be able to narrow the Posts results down to entries by author "Morrison" published after "2016".
Drawbacks
Can't think of any real drawbacks. But the advanced search would most likely need to appear in a new modal and that may be tricky for mobile first designs.
Unresolved questions
No response
Hello
Thank you for the issue, this is something that is in the pipeline, we are thinking about how to implement it in the best possible way. A first step to this was to add the custom filters property. Next step is to add a more complex query builder which should fit any use case for the queries