Would a Regex search that includes links to files within a folder (also with headings and block references) be enough? That also works in the graph view when you use it as your search. (Make sure to include orphans.)
This supports one level of nesting (at least that’s what I’ve built it for.)
It includes the links from files in the root level or files in one folder to another folder.
Exchange folder with your folder name.
This only works if you use relative links.
Don’t forget that you need to put the Regex between slashes.
You can use this Regex to find all the links to a particular file in a particular folder:
Alternative would be filtering directly in backlink pane, requested as part of Filtering Everywhere!
But having the option available in search has use cases too.
Desired in:
Obsidian url scheme
Embedded searches, with ability to reference containing note without breaking the search when the file is renamed and all backlinks updated.
For example by accessing variable “filename” of current file, e.g. as link:{{filename}} or link:(!filename).
AFAIK, Embedded search is the only place where it makes sense to speak about “backlink:”, otherwise it is going to be just “link:”. E.g. “link:(file name)” as a convenience to match all links to corresponding file:
Edit: this does not yet specify query for all unlinked mentions for a file identified by filename, i.e. ordinary matches for filename, title and all aliases.
I was just about to create another feature request Orpan Search Query and realized that this standing request could probably accommodate that use case if it was implemented. (Atomic requests are more manageable, so let me know if this seems like it should be it’s own feature request.)
Orpan Search Query
It would so be useful to see an ordered list of orphan files.
Proposed solution
Clearly Obsidian already has the capability to filter orphans, as demonstrated by the Graph View filter toggle.
I want some way to do the same thing in the search bar and inline queries.
Graph view is nice, but it’s so random and unwieldy in a large vault. We need a search query that provides a sorted list in the search bar and inline
` ` `query
is-orphan:
` ` `
Or in the style of the proposed solution above,
` ` `query
links:NULL
` ` `
Please note that to be an orphan file, it must not have any Obsidian links in the body nor any back-links. There are several posted regex queries on discord. None of them address the back-link side of the connection.
+1 for this.
A link search operator would also enable to search for all links with a special character (i.e mark transient notes not yet created with [[~ a special character to put in the writing inbox]]).
I agree with the original proposal and just wanted to give a particular example.
Use Case:
If I’d want to find all Leetcode problems (tagged with: #leetcode/problem), which also have links to [[Stack]]. Similar things can be accomplished with the DataView plugin, but it’s not as dynamic as it would be by simply searching.
In General:
Making a search query which combines tags, links, and text content is something I often need to do.
Using Regex doesn’t seem like a natural way of accomplishing that.
As a search operator it would allow booleans (find all notes that are linked from one note, but not from another, or linked from multiple notes), filter in the graph view, and create very useful organization as an embedded search query.
What about “incoming:”, “outgoing:” as search operators?
incoming:Foo or outgoing:Bar or outgoing:"Note With Spaces In The Name"
And negative filter -incoming:Foo or -outgoing:Bar
I think “incoming” and “outgoing” are simple search operators here.
This would make it significantly easier to find files that have multiple links. Lets say I had two MOCs, one for a company I work for (i.e, Disney), and one for projects.
With this functionality, it’d be simple to do outgoing:Disney outgoing:projects to find all files that link to both. Now I have a list of all projects worked on at Disney.
Combining several links and combining links and tags in the obsidian search would be invaluable. Otherwise tags remain a lot more useful for working with notes. Links, however, are great for Graphs and I don’t want to lose that functionality.
Am I right though that the Dataview plugin already includes a links search along with tags, etc.?
I would like to be able to query by links. Both incoming and outgoing if you can.
But specifically I am using some links as tags, for example “[[moscow]]”, therefore I want to find all documents that have “[[moscow]]”. But simply line:“[[moscow]]” does not always work, because sometimes it’s “[[moscow|Москву]]”. There are some arcane regexes mentioned above, but can you maybe please grant us this simple request of letting us query by inlinks and outlinks? Just like we can query by tags.
I’ve quit Evernote because they wouldn’t let me have simple queries. Obsidian is better, but this request is going for years already, this is some fundamental thing, I don’t see how you don’t make it top priority feature.
I find it very strange that this can’t be done considering how quintessential of a function links are in Obsidian. Even [[link]] can’t be searched.
Why I would like this:
I’m a heavy user of Canvas. I would like to be able to drag and drop notes with the link [[Ethics]] to a Canvas, which would be easy if I could have them displayed in the search pane.
Dragging notes from the [[Ethics]] backlink pane to the Canvas works, but it’s tedious because every time I’ve dragged a note into the Canvas, the Canvas becomes the active note and the backlink pane clears. It also only allows dragging one note at a time, because you can’t select multiple notes and then drag them.
In this case, being able to search for [[Ethics]] or link:ethics and drag notes from the search results would be a lot easier. Although you can’t select and drag multiple notes there either, the results would at least remain visible even when the Canvas file is active, which isn’t the case for the [[Ethics]] backlink pane.