I’m using the logseq api and trying to search for text and get the resultant blocks.
I’m using the logseq.DB.q api to search and noticed that it is case sensitive, so its not giving me the results when if the search query is not an exact case match.
How can I get a case insensitive search using logseq.DB.q
Apparently the input argument expects zero or more inputs, those that go inside :inputs [] of an Advanced Query. See how "home" is passed in this post, in order to become ?name.
if I want a simple case insensitive search targeting the entire graph, then I can use logseq.App.Search (this is not documented as of now)
if I want advanced case insensitive search to search only on a specific page or tag etc… then I need to use logseq.DB.datascriptQuery along with regular expressions
Hi everybody, I think this block is a very helpful entry point.
I am trying to retrieve blocks based on a python query with a block uuid as parameter.
The use case is to be able to export a group of blocks and have their properties be shown as independent columns. Since some of the properties have references to other blocks as values, it would be also very useful to be able to choose what to show in the property (the content or a property of the referenced block, instead of having its uuid).
The issues I am facing are different, but this is the main one:
when I use the following query, I manage to retrieve the content of a block:
I have seen, that it might be an issue in the formatting of the uuid. Unfortunately I get either the same error whe I use f"{uuid}“, or an empty result when I use f”‘{uuid}’". The same happens when trying to format in the query via “[(str ?uuid) ?str] [(= ?str ?uuid)]”
Any Idea on why this happen or alternative ways to achieve my objective?
Hi metaloid, thank you very much! I finally managed to make it work! Now that I look at your version, I understand that my mistake was to use “uuid” for both the uuid from the logseq database and the input variable.
the order of the quotation marks for the input variable (f'"{uuid}"' - meaning ' single on the outside and " double in the inside) is important. No other combination worked.
As additional information, this worked with both these request variations: