Add UI and scripting support to embedded queries

Just to add more clarity from my perspective of what is wanted / needed in this overall feature request. I believe there are two parts to it:

  1. Add the Search results settings buttons like the screenshot below (same ones we get with Search results in the left side panel Search view)

    • image
  2. Add ability to add syntax within a Search Query embed to persist the settings like a sort, show more context, collapse etc. parameters so that the Search Query embed itself can dictate how the results are showing by default.

    • Something like adding in the query embed: ?sort=dateModAsc?context=true ...
40 Likes

Use case or problem

With new embedded queries, it would be useful to have an explicit sort parameter.

Proposed solution

Add sort: to the query syntax.

Current workaround (optional)

None

Related feature requests (optional)

None?

60 Likes

I agree, this would be great. A useful sort type would be alphabetical by matched text. One use case is sorting tasks by due date, e.g.

Note 1: - [ ] 20210225 Task 1
Note 2: - [ ] 20210110 Task 2
Note 3: - [ ] 20201220 Overdue task

When sorting by matched text, the results would be:

- [ ] 20201220 Overdue task
- [ ] 20210110 Task 2
- [ ] 20210225 Task 1
3 Likes

This is for my workflow extremely important. Especially when you deal with long Tag Lists to sort from newest to oldest you need this kind of sorting.

2 Likes

+1 for this. That said you’re keying off the alphanumeric task name itself whereas I am actually looking to sort by file modification data. I think both are valid options.

Especially if you search fir follow ups and todos a sort by modification date is important.

Use case or problem

The embedded search query is great for time management, e.g. inserting bespoke search queries into daily notes to find the current week’s task. But some results are collapsed, meaning it might be easy to miss tasks. Currently, though in the search window, you can expand / collapse all notes, there is no such option for embedded queries.

Proposed solution

Provide the facility to set various options within the search query. These would need a special syntax , e.g.

#Options: collapse = true, ascending_sort = false

31 Likes

I agree. This would make large search results from embedded queries much more readable and/or informative.

1 Like

Yip +1 for this feature - same sort options like the current search but with a sort parameters in the query.

For super explicit context, it’d be cool if the embedded search could look like this:

10 Likes

Up-voting this feature request. +1

3 Likes

Also adding my +1. Thanks!

I do like the above look … equal to the options in “Linked mentions” and search. So it looks like the code to do it like that is already there.

An option to group by first letter of the page being linked with an index at the top would be great to make large results (my music video collection for example) manageable.

EDITED after 2 hours : In the Discord I was pointed at the dataview communicty plugin that for me does exactly what I want. I still have to move the links to seperate pages but that is more like obsidian works and makes it also easier to link to seperate pages.

1 Like

+1 for this

+1 from me too

+1 for me too

Definitely a +1 for this

This doesn’t exist yet right? +1

+1 for this. I keep a note as a catalogue for the different types of software I use, and it would be great to be able to collapse the entire embedded search.

+1 on collapse operator for embedded queries. Typically, I use queries on “maps of content” pages – that is, pages which serves as indexes into other pages. In these cases, it would be very nice to display the query results without expanding. For example, I would like to see a query for my YouTube channels related to gardening display collapsed results rather than expanded results as it now works.

2 Likes