rilldata / rill

Rill is a tool for effortlessly transforming data sets into powerful, opinionated dashboards using SQL. BI-as-code.
https://www.rilldata.com
Apache License 2.0
1.66k stars 111 forks source link

web: add ability to use LIKE 'x%' instead of LIKE '%x%' for suggestions #5082

Open azat opened 3 months ago

azat commented 3 months ago

Right now all completion is implemented with LIKE '%x%' (well, ILIKE to be precise), but this does not allows to use indexes (I'm talking in context of ClickHouse) so it will be good to have an option to switch to startsWith filter, so that the comletion will works way more faster.

mindspank commented 3 months ago

@AdityaHegde as I think you are looking at ClickHouse search?

mindspank commented 3 months ago

@azat Thanks for the report! Would you expect that to be the default behaviour or would you like to be able to toggle between search behaviour with a property on the dimension?

Some psuedo

dimensions:
  - column: country
     label: Country
     name: my_dim_id
     search: full_wild / start_wild / end_wild / exact
azat commented 3 months ago

as I think you are looking at ClickHouse search?

Yes, but I think it is a general thing, since all backends should support this (see the referenced commit, that is a hack that I used now, AFAIR only changes in web-common/src/features/dashboards/selectors/index.ts was needed, but other two files I left just in case)

Would you expect that to be the default behaviour or would you like to be able to toggle between search behaviour with a property on the dimension?

It maybe useful to switch indeed, so you suggestion looks good

nishantmonu51 commented 1 month ago

Design link - https://www.notion.so/rilldata/Search-bar-settings-3f8ae0f0ee694ba2bf3d8a0c54f73fef?pvs=4