cozemble / monorepo

A data and process canvas
https://cozemble.com
Apache License 2.0
13 stars 1 forks source link

Support for free text search over records #14

Closed mike-hogan closed 1 year ago

mike-hogan commented 1 year ago

When I am viewing a list of records, let's say a list of Customers, I want to be able to filter the list by free text search.

So if I type in "mike" into the search bar, all Customers containing the string "mike" anywhere in their schema are shown

samsoft00 commented 1 year ago

This is interesting, so, the structure will look like right? @mike-hogan

enum FilterBy {
  NAME,
  AGE,
  CREATED_AT,
}
query {
    search: String!,
     filter_by: [] //fetch the model keys as enum. e.g name,
}
mike-hogan commented 1 year ago

I didn't intended this to be about typescript interfaces @samsoft00 . I mean the data editor, which is model driven, will "just know" how to do free text search against the model it is viewing. It knows all the properties in the model, so it can dynamically generate a query to implement the search.

That would be enough to get going.

Keeping an index or using a search engine is an optional improvement that we can make should the need arise.

You had extra thoughts around the typescript interface?

mike-hogan commented 1 year ago

Not doing this using right now, as we have moved away from the idea of a custom sql schema for each tenant, back to generic models and records. First step is to see if postgres jsonb querying does all we need.

mike-hogan commented 1 year ago

What I meant was not doing this (gql) approach to free text search. But we still need the feature. It's done now using a trigger that "textifies" the record, and added support for q=xxxx to the records endpoint