From a3383f1f6d21326328e37838fb764a35abe11de4 Mon Sep 17 00:00:00 2001 From: Andrey Goncharov Date: Wed, 11 Oct 2023 07:32:32 -0700 Subject: [PATCH] Add power search docs Reviewed By: antonk52 Differential Revision: D50170852 fbshipit-source-id: 36b07d70ab136cc3e0165473c784bf14f0bff302 --- docs/extending/power-search.mdx | 13 +++++++++++++ website/sidebars.js | 1 + 2 files changed, 14 insertions(+) create mode 100644 docs/extending/power-search.mdx diff --git a/docs/extending/power-search.mdx b/docs/extending/power-search.mdx new file mode 100644 index 000000000..5b424a5f0 --- /dev/null +++ b/docs/extending/power-search.mdx @@ -0,0 +1,13 @@ +--- +id: power-search +title: Power Search +sidebar_label: Power Search +--- + +By default, your [table](../tutorial/js-table.mdx) has a power search bar. It allows to search through the entire row as a serialized string or through individual columns. Based on the column type, power search provides different search operators for columns. +For instance, for string values it can check if a string contains a substring or even matches some other string exactly. At the same time, for dates Flipper can filter out records after or before a certain date. +Since Flipper does not have a way of identifying the column type in advance, it always assumes that every column is a string. If you want you can tell Flipper how to handle a column and what power search operators should be available. + +You can see a live example of how you can provide the power search config [here](https://fburl.com/code/rrxj86e5). + +You can find the complete list of supported operators [here](https://github.com/facebook/flipper/blob/main/desktop/flipper-plugin/src/ui/data-table/DataTableDefaultPowerSearchOperators.tsx). diff --git a/website/sidebars.js b/website/sidebars.js index 45759f8f7..782b8b59e 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -124,6 +124,7 @@ module.exports = { { 'Desktop Plugin APIs': [ 'extending/flipper-plugin', + 'extending/power-search', 'extending/styling-components', 'extending/style-guide', 'extending/deeplinks',