How to use the @elastic/eui.EuiSearchBar.Query function in @elastic/eui

To help you get started, we’ve selected a few @elastic/eui examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github elastic / kibana / x-pack / legacy / plugins / ml / public / jobs / jobs_list / components / job_filter_bar / job_filter_bar.js View on Github external
}, () => {
        // trigger onChange with query for job id to trigger table filter
        const query = EuiSearchBar.Query.parse(selectedId);
        this.onChange({ query });
      });
    }
github elastic / kibana / x-pack / legacy / plugins / ml / public / settings / filter_lists / edit / edit_filter_list.js View on Github external
function getMatchingFilterItems(searchBarQuery, items) {
  if (items === undefined) {
    return [];
  }

  if (searchBarQuery === undefined) {
    return [...items];
  }

  // Convert the list of Strings into a list of Objects suitable for running through
  // the search bar query.
  const allItems = items.map(item => ({ value: item }));
  const matchingObjects =
    EuiSearchBar.Query.execute(searchBarQuery, allItems, { defaultFields: ['value'] });
  return matchingObjects.map(item => item.value);
}
github elastic / kibana / x-pack / legacy / plugins / ml / public / application / jobs / jobs_list / components / job_filter_bar / job_filter_bar.js View on Github external
() => {
          // trigger onChange with query for job id to trigger table filter
          const query = EuiSearchBar.Query.parse(selectedId);
          this.onChange({ query });
        }
      );
github elastic / kibana / x-pack / plugins / ml / public / components / job_selector / custom_selection_table / custom_selection_table.js View on Github external
selectedIds,
  singleSelection,
  sortableProperties,
  timeseriesOnly
}) {
  const [itemIdToSelectedMap, setItemIdToSelectedMap] = useState(getCurrentlySelectedItemIdsMap());
  const [currentItems, setCurrentItems] = useState(items);
  const [lastSelected, setLastSelected] = useState(selectedIds);
  const [sortedColumn, setSortedColumn] = useState('');
  const [pager, setPager] = useState();
  const [pagerSettings, setPagerSettings] = useState({
    itemsPerPage: JOBS_PER_PAGE,
    firstItemIndex: 0,
    lastItemIndex: 1
  });
  const [query, setQuery] = useState(EuiSearchBar.Query.MATCH_ALL);
  const [error, setError] = useState(null); // eslint-disable-line

  useEffect(() => {
    setCurrentItems(items);
    handleQueryChange({ query: query });
  }, [items]); // eslint-disable-line

  // When changes to selected ids made via badge removal - update selection in the table accordingly
  useEffect(() => {
    setItemIdToSelectedMap(getCurrentlySelectedItemIdsMap());
  }, [selectedIds]); // eslint-disable-line

  useEffect(() => {
    const tablePager = new Pager(currentItems.length, JOBS_PER_PAGE);
    setPagerSettings({
      itemsPerPage: JOBS_PER_PAGE,
github elastic / kibana / x-pack / legacy / plugins / index_management / public / store / selectors / index.js View on Github external
(indices, allIds, tableState) => {
    let indexArray = allIds.map(indexName => indices[indexName]);
    indexArray = filterByToggles(indexArray, tableState.toggleNameToVisibleMap);
    const systemFilteredIndexes = tableState.showSystemIndices
      ? indexArray
      : indexArray.filter(index => !(index.name + '').startsWith('.'));
    const filter = tableState.filter || EuiSearchBar.Query.MATCH_ALL;
    return EuiSearchBar.Query.execute(filter, systemFilteredIndexes, {
      defaultFields: defaultFilterFields,
    });
  }
);
github elastic / kibana / x-pack / plugins / endpoint / public / components / search_bar.tsx View on Github external
private defaultOnChange = ({ query }: { query: string }) => {
    const { searchItems, defaultFields, updateOnChange } = this.props;

    const result = EuiSearchBar.Query.execute(query, searchItems, {
      defaultFields,
    });
    this.setState({ currentResult: result });
    updateOnChange({ updatedResult: result });
  };
github gojek / turing / ui / src / router / list / ListRoutersTable.js View on Github external
const onChange = ({ query, error }) => {
    if (error) {
      return error;
    } else {
      return EuiSearchBar.Query.execute(query, items, {
        defaultFields: ["name"]
      });
    }
  };
github elastic / kibana / x-pack / legacy / plugins / index_management / public / store / selectors / index.js View on Github external
(indices, allIds, tableState) => {
    let indexArray = allIds.map(indexName => indices[indexName]);
    indexArray = filterByToggles(indexArray, tableState.toggleNameToVisibleMap);
    const systemFilteredIndexes = tableState.showSystemIndices
      ? indexArray
      : indexArray.filter(index => !(index.name + '').startsWith('.'));
    const filter = tableState.filter || EuiSearchBar.Query.MATCH_ALL;
    return EuiSearchBar.Query.execute(filter, systemFilteredIndexes, {
      defaultFields: defaultFilterFields,
    });
  }
);
github elastic / kibana / x-pack / plugins / index_management / public / lib / render_badges.js View on Github external
const clickHandler = () => {
        filterChanged
          && filterExpression
          && filterChanged(EuiSearchBar.Query.parse(filterExpression));
      };
      const ariaLabel = i18n.translate(