Non-tag queries - Neuron

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Sridhar Ratnakumar

Would anyone have any use case at all as to query for zettels based on information other than tags? I'm beginning to wonder if queries should be kept simple, supporting only tags.

felko

I think it depends whether queries are meant to be used mainly from the zettel links themselves or if they should provide a powerful API for e.g. implementing a search engine. For example I use ripgrep in my zettel-mode for searching by title and text but I use neuron ... query to search by tags. Implementing a search engine is hard but I think it would be useful.

felko

I'm starting to think that an integrated search page in the web application would be nice, sadly this requires abandoning fully static sites.

Sridhar Ratnakumar

I'm starting to think that an integrated search page in the web application would be nice, sadly this requires abandoning fully static sites.

Well there are JavaScript based search libraries. Neuron can generate the index for using from the web browser.

Sridhar Ratnakumar

eg https://github.com/bvaughn/js-search

JS Search is an efficient, client-side search library for JavaScript and JSON objects - bvaughn/js-search
felko

Yeah but there is no way to use neuron queries to implement the search engine. So I guess queries by text won't be very useful after all.

Sridhar Ratnakumar

When you generate .html files, we can also write a .json index (using neuron query), and use that from JavaScript.

felko

Hmm I'm not sure how that would work, the actual query would have to be processed from JavaScript. What I had in mind was to have a single search engine, accessible from neuron queries, without using any JS search library at all.

felko

If that's impossible then yeah, I guess queries could be kept simple, with only queries by tags (and maybe hierarchical tags later)

felko

Another use case for non tag queries might be to query the graph itself and find backlinks for example. That would be useful for editor support, because it would allow users to browse the zettelkasten without opening the web app.

Sridhar Ratnakumar

https://github.com/srid/neuron/issues/74

Add to query the functionality to retrieve nearby zettels zquery://search?linkFrom=<zid> zquery://search?linkTo=<zid> zquery://search?forestFrom=<zid> zquery://search?forestTo=&lt...