I am studying datagrok API with help documentation. Unfortunately, the link to smart-search is no longer valid. https://datagrok.ai/help/datagrok/smart-search
I guess I can gain information by smart-search example about the usage of filter
method (ProjectsDataSource | Datagrok) and I would like to know how to use filter
. In the example of projects-list (Datagrok), I understand that keyword searching is possible. If there are any flexible and useful options, I would like to know how to do it.
Best regards,
Kosuke
Hi Kosuke,
The link to the Smart Search documentation seems to be unavailable, but I can provide you with the key details.
Smart Search allows free-text input to define complex queries. It supports AND
and OR
operators, parentheses for grouping, and filtering by tags (#demo
), properties (e.g., author = "john@google.com"
), and date-based conditions (createdOn > -1w
).
Regarding the filter
method in ProjectsDataSource
(Datagrok API), it allows searching based on project properties. You can filter by name or other properties using expressions. For example, to find projects named “Chem” created by a user named “John,” you can use:
await grok.dapi.projects.filter(`name="Chem" & firstName="John"`).list();
Flexible options include filtering by tags, creation date, and user-related properties. For example:
- Projects tagged as either #demo or chem
await grok.dapi.projects.filter('#demo or #chem').list();
- Projects created in the last 7 days
await grok.dapi.projects.filter(`createdOn > -1w`).list();
- Projects created by recently joined users (joined within 5 days)
await grok.dapi.projects.filter(`author.joined > -5d`).list();
Let me know if you need more details!
Best regards,
Pavlo
Dear Pavlo,
Thank you for very informative feedback. It’s like pd.DataFrame.query in python.
I’ll touch and try, then I let you know once I have some questions.
Best regards,
Kosuke