logseq / logseq/logseq

Detect block properties (particularly tags) when using card search

Open
#4,768 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

:type/enhancement card
Dominant language
Clojure
Stars
45k
Forks
2.8k
Avg merge
1d 22h
Merged PRs (30d)
105

Description

Problem in short: The current card query function only detects tags like this '#tag1', and not when the tags are in the block properties like this 'tags:: tag1'. This undermines the functionality of the card search for studying as, in many cases, having '#tag1' appear in the first page of a card gives away the answer.

Solution: Make block properties searchable through the card query function with the syntax {{cards (property tags tag1)

Problem explained in full

A problem with the current card query function is that in it only detects tags that are attached to cards like this '#tag1' and not cards that have the tag in their block properties, e.g. 'tag:: tag1'.

This completely undermines the functionality of using the card query function to study. For example, suppose that I am studying 'Module 1' of my Biology course and I tag all cards associated with that Module '#[[Biology Module 1]]. Imagine that I also want to keep track of all the cards associated with mitochondria, so I tag them with '#mitochondria'.

The problem with this is that when I go on to review my cards for Biology Module 1 '#mitochondria' then appears in the first block of the cards giving away the answer whenever you're reviewing them, see the image below.

image

One way around this is to tag the card by adding 'mitchondria' to the block properties like this 'tags:: Mitochondria. But then the problem is that if I want to search for cards associated with mitchondria the cards won't appear, as the card query function doesn't detect them.

The ordinary query function does detect these properties, so I'm hoping that it will be easy to add this functionality to the card query function.

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the card query function and compare its tag handling with the ordinary query function, which the issue says already detects block properties. Verify how the proposed {{cards (property tags tag1) syntax should be parsed. Done means card searches return cards matching tags stored in block properties without exposing those tags in the card’s first page.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
search
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.