Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
f0c5dd27
Unverified
Commit
f0c5dd27
authored
1 year ago
by
Ngoc Khuat
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
Update search api documentation to includes available filters (#35405)
parent
e8222896
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/metabase/api/search.clj
+21
-9
21 additions, 9 deletions
src/metabase/api/search.clj
with
21 additions
and
9 deletions
src/metabase/api/search.clj
+
21
−
9
View file @
f0c5dd27
...
...
@@ -468,7 +468,7 @@
[
:offset
{
:optional
true
}
[
:maybe
ms/Int
]]
[
:table-db-id
{
:optional
true
}
[
:maybe
ms/PositiveInt
]]
[
:search-native-query
{
:optional
true
}
[
:maybe
boolean?
]]
[
:verified
{
:optional
true
}
[
:maybe
true?
]]]]
[
:verified
{
:optional
true
}
[
:maybe
true?
]]]]
:-
SearchContext
(
when
(
some?
verified
)
(
premium-features/assert-has-any-features
[
:content-verification
:official-collections
]
...
...
@@ -517,14 +517,26 @@
:models
search.config/all-models
})))
(
api/defendpoint
GET
"/"
"Search within a bunch of models for the substring `q`.
For the list of models, check [[metabase.search.config/all-models]].
To search in archived portions of models, pass in `archived=true`.
To search for tables, cards, and models of a certain DB, pass in a DB id value
to `table_db_id`.
To specify a list of models, pass in an array to `models`.
"
"Search for items in Metabase.
For the list of supported models, check [[metabase.search.config/all-models]].
Filters:
- `archived`: set to true to search archived items only, default is false
- `table_db_id`: search for tables, cards, and models of a certain DB
- `models`: only search for items of specific models. If not provided, search for all models
- `filters_items_in_personal_collection`: only search for items in personal collections
- `created_at`: search for items created at a specific timestamp
- `created_by`: search for items created by a specific user
- `last_edited_at`: search for items last edited at a specific timestamp
- `last_edited_by`: search for items last edited by a specific user
- `search_native_query`: set to true to search the content of native queries
- `verified`: set to true to search for verified items only (requires Content Management or Official Collections premium feature)
Note that not all item types support all filters, and the results will include only models that support the provided filters. For example:
- The `created-by` filter supports dashboards, models, actions, and cards.
- The `verified` filter supports models and cards.
A search query that has both filters applied will only return models and cards."
[
q
archived
context
created_at
created_by
table_db_id
models
last_edited_at
last_edited_by
filter_items_in_personal_collection
search_native_query
verified
]
{
q
[
:maybe
ms/NonBlankString
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment