Closed mardukbp closed 4 years ago
Hi @mardukbp! I'm not really maintaining this plugin anymore, but you could probably achieve something like the desired effect by only doing FTS on tiddlers whose title matches "Robot Framework" - so something like this:
[!is[system]search:title{$(searchTiddler)}ftsearch{$(searchTiddler)}]
However, that wouldn't pick up tiddlers with "robot framework" in the name if you search for something like "robots framework". You could also try modifying the code that builds the index (index-worker
and shared-index
, I think?) to omit tiddler text fields from the search index.
@hoelzro Thank you for your prompt reply. In the end I found a simple solution.
$:/language/Search/Matches/TitleLiteralAnchored
with the contents:Title begins with:
$:/core/ui/DefaultSearchResultList
//<small>{{$:/language/Search/Matches/TitleLiteralAnchored}}</small>//
<$list filter="[!is[system]search:title:literal,anchored{$(searchTiddler)$}sort[title]limit[250]]" template="$:/core/ui/ListItemTemplate"/>
The literal
flag means that the query must match exactly. The anchored
flag means that the match must occur at the beginning of the string.
In my TW I have some tiddlers whose title begins with "Robot Framework" and other tiddlers that contain "Robot Framework" in the title. Since this plugin claims to sort search results by relevance I was expecting that if my query is "Robot F" then the list of results begins with all the tiddlers whose title begins with "Robot Framework".
However, the first result is a tiddler whose title contains "Robot Framework". It is followed by some tiddlers whose title begins with "Robot Framework" and then some tiddlers that do not contain "Robot Framework" in the title and then more tiddlers whose title begins with "Robot Framework".
I guess that lunr is assigning the scores based on the full content of the tiddlers, not only their title. However, I only care about the tiddler's title. It would be great to be able to configure the plugin to only search in the title.
If there is an easy way to achieve what I want using only built-in TW functions, please tell me.