Use PageRank in Ctrl+O search results?

Use case or problem

I often search via the Ctrl+O/Cmd+O menu to open files. As an example, I have two files, “Linear Algebra” and “Linear Map”. When I search “Linear” the “Linear Map” note comes up first (perhaps you’re using an edit distance search algorithm?). I would like “Linear Algebra” to appear first because it’s a larger and more interconnected note, so it’s easier to find related topics via that note.

Proposed solution

I think using a variant of the PageRank algorithm based on the number of links between notes to more heavily weight more commonly referenced notes in the search results would be useful. This is because the number of links into a note is a good proxy for how often you need to open it / how important it is to you. I think even just adding weight to results with some heuristic something like n = links + backlinks/2 + 10 (log wordcount - log lastedited) would be a good enough approximation of PageRank for my needs.

4 Likes

@OliverBalfour I’m surprised there are so few topics that mention PageRank. :smiley: I’ve made a new Python package obsidiantools - in sum I managed to calculate PageRank values for a basic vault via the vault.graph object in my API.

I use Python’s NetworkX (nx) package to calculate the PageRank values so this is one line of additional code:
notes-pagerank

Demo graph (visualisation of NetworkX graph)

Obsidian.md docs talk a lot about the power of backlinks… PageRank looks at backlinks with a mind for their quality at its core, so it would be a useful algo for Obsidian analytics.

I collect metadata about notes in a Pandas dataframe (which can go to formats like JSON). Including PageRank in there would be straightforward. The next step after that would be a plugin that integrates with the Python package.