Skip to content

Comments

fix: autocomplete for lucene column values#720

Merged
kodiakhq[bot] merged 8 commits intov2from
aaron/key-value-autocomplete
Apr 8, 2025
Merged

fix: autocomplete for lucene column values#720
kodiakhq[bot] merged 8 commits intov2from
aaron/key-value-autocomplete

Conversation

@knudtty
Copy link
Contributor

@knudtty knudtty commented Mar 28, 2025

image

Added autocomplete for potential search values for lucene where clauses.
Added testing for useAutoCompleteOptions and useGetKeyValues.

Ref: HDX-1509

@changeset-bot
Copy link

changeset-bot bot commented Mar 28, 2025

🦋 Changeset detected

Latest commit: 7f06fa2

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

formatKeyValPair: (key: string, value: string) => string;
}

export function useAutoCompleteOptions(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New hook to do facilitate all of the autocomplete options and inputs. The formatter arg is an interface class that'll be different for lucene and sql

disableRowLimit,
}: {
chartConfig: ChartConfigWithDateRange;
chartConfigs: ChartConfigWithDateRange | ChartConfigWithDateRange[];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed for consistency with tableConnections in useAllFields

(
await Promise.all(
chartConfigsArr.map(chartConfig =>
metadata.getKeyValues({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactored to support multiple chart configs

@knudtty knudtty force-pushed the aaron/key-value-autocomplete branch from 094b997 to 3d9f864 Compare March 28, 2025 20:30
databaseName,
tableName,
},
timestampValueExpression: '',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we want to add time range filtering? When users perform a search, we can narrow down the time range to speed up the query

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely, what do you think is appropriate? Hardcoding some expression (last 24 hours) or prop drill it in from somewhere?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm...now when I think about this again. Its probably not straightforward to bypass the time range config. Given we have a limit on scanning rows, this should be fine for now.

Copy link
Member

@wrn14897 wrn14897 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the coolest feature imo 💪 💪 💪 Can't wait to ship it


export class LuceneLanguageFormatter implements ILanguageFormatter {
formatFieldValue(f: Field): string {
return f.path.join('.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to fix it for now but I'm curious what happened if the key has '.' in it

@kodiakhq kodiakhq bot merged commit 092a292 into v2 Apr 8, 2025
4 checks passed
@kodiakhq kodiakhq bot deleted the aaron/key-value-autocomplete branch April 8, 2025 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants