Skip to content

Field suggestions update to match changed index in query #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import { EuiTextArea } from '@elastic/eui';
import { IQueryBarProps } from './search';
import { getDataValueQuery } from './queries/data_queries';
import { isEmpty, isEqual } from 'lodash';
import DSLService from 'public/services/requests/dsl';

let queryLength: number = 0;
let currIndex: string = '';
let currField: string = '';
let currFieldType: string = '';
Expand Down Expand Up @@ -210,8 +210,9 @@ const getIndices = async (dslService: DSLService) => {
};

const getFields = async (dslService: DSLService) => {
if (fieldsFromBackend.length === 0 && currIndex !== '') {
if (currIndex !== '') {
const res = await dslService.fetchFields(currIndex);
fieldsFromBackend.length = 0;
for (const element in res?.[currIndex].mappings.properties) {
if (res?.[currIndex].mappings.properties[element].type === 'keyword') {
fieldsFromBackend.push({ label: element, type: 'string' });
Expand Down