hoelzro / tw-full-text-search

Full text search plugin for TiddlyWiki powered by lunr.js
https://hoelz.ro/files/fts.html
Other
25 stars 4 forks source link

Request: Search results ordering option #32

Open TiddlyTweeter opened 5 years ago

TiddlyTweeter commented 5 years ago

The latest version is really shaping up into a useful tool for TW. Tx!

For my use case the Sort-Order of results matters. Let me give an example.

You writing a novel and use Tiddler titles to order them (e.g. Chap 7.04, Chap 7.05 etc).

The way the tool delivers results by "hit relevance" is very good under some situations. But its not ideal for coping with sequential texts where their original (alpha-numeric) order matters. In those cases you want to view/edit them in original written sequence.

My request: Would it be possible to add a directive to be able to define a sort order for results?

Hope this is clear! Best wishes, Josiah

hoelzro commented 5 years ago

@TiddlyTweeter Thanks for taking the time to try out the plugin, and for the feedback! I'm trying to think of the best way to reconcile this with the "core" of the FTS plugin; after all, the relevance-based search order is one of the "features", as you point out. At the bare minimum, you could tweak the search results tiddler to add sort[] to the end of the filter, but I need to think about how sorting the results alphabetically would fit into the grand scheme of things.

TiddlyTweeter commented 5 years ago

@hoelzro FWIW I agree that "relevance sort" is king and good. My comment only applies to a few narrow cases. But if those could be supported I think it could help on some writing tasks. Maybe is could be done, as you say, by option to add a final sort.

In a way I'm not even expecting you to provide a solution--an alternative would be enough clues about how the end user could do it.