quickwit-oss / quickwit-datasource

Quickwit data source for Grafana
GNU Affero General Public License v3.0
41 stars 10 forks source link

feat: Improved autocompletion #135

Open uptickmetachu opened 1 month ago

uptickmetachu commented 1 month ago

Hi first time contribution here :)

My typescript is also bad so please be gentle and suggest feedback where neccessary!

Love quickwit but wanted to try a small PR to see how easy it was to make changes to the plugin and hopefully contribute some more changes in the future.

Motivation

Autocompletion is great but two things bugged me:

  1. When completing between two quotes; eg: span_attributes.filename:"CURSOR_IS_HERE" the suggestions will be surrounded by quotes. When accepting the suggestion, the final quote is inserted before the ending quote and as such we end up with incorrect syntax of span_attributes.filename:"SUGGESTION"" <--extra quote
  2. Autocompletion is limited to the first 100 results. This PR uses the field value to prefix search the terms. We need this when we are searching across a field with thousands of terms but the current implementation will never return any result beyond the initial 100 (sorted alphabetically).
fmassot commented 4 weeks ago

Hey @uptickmetachu! thanks for your contribution! Let me review it and get back to you.

uptickmetachu commented 3 weeks ago

Happy to add a Loom/video recording of the changes in action as well if that helps with the review.

fmassot commented 3 weeks ago

Not needed, will review it today! thanks!