Skip to content

Commit

Permalink
Use a lenient regexp to match fields in autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
ddelemeny committed Feb 21, 2024
1 parent 0e67cfb commit 055080a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/datasource/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function useDatasourceFields(datasource: QuickwitDataSource) {
const getSuggestions = useCallback(async (word: string): Promise<Suggestion> => {
let suggestions: Suggestion = { from: 0, options: [] };

const wordIsField = word.match(/([\w\.]+):"?(\S*)/);
const wordIsField = word.match(/([^:\s]+):"?([^"\s]*)"?/);
if (wordIsField?.length) {
const [_match, fieldName, _fieldValue] = wordIsField;
const candidateValues = await datasource.getTagValues({ key: fieldName });
Expand Down

0 comments on commit 055080a

Please sign in to comment.