On Saturday, December 9, 2017 at 7:06:51 AM UTC-8, John wrote:
>
> When I search in TW5 with a phrase, I get all the tidders which have a 
> word or more of the phrase in any sequence in the title or the body. 
>
> Is there an option or plugin to search only for the exact phrase in the 
> title or the body?
>

You can use the [regexp[...]] filter operator to search for exact phrase 
matches including spaces.

1) Open the $:/AdvancedSearch panel (click the magnifying glass icon next 
to the regular sidebar search input field)
2) In $:/AdvancedSearch, switch to the "Filter" tab
3a) To search titles, enter your search syntax like this:
   [regexp[your phrase here]]
3b) To search tiddler text, enter your search like this:
   [regexp:text[your phrase here]]

Notes:
* Because the syntax uses square brackets, you cannot search for text that 
includes square brackets.
* If you want to search both title AND text fields at the same time, you 
can combine the filters in a sequence, separated by a space, like this:
   [regexp[your phrase here]] [regexp:text[your phrase here]]
* If you don't want to use the $:/AdvancedSearch interface, you can create 
your own custom interface by putting the following syntax into a tiddler 
you create:

<$edit-text tiddler="$:/temp/mysearch" tag="input" default=""/><br>
<$reveal state="$:/temp/mysearch" type="nomatch" text="">
<<list-links "[regexp{$:/temp/mysearch}] [regexp:text{$:/temp/mysearch}] 
-[title[$:/temp/mysearch]]">>
</$reveal>

* The $edit-text widget stores your search input in $:/temp/mysearch (you 
can use any tiddler name you like, but something starting with 
"$:/temp/..." is recommended to avoid cluttering up your regular list of 
tiddlers)
* The $reveal widget prevents listing ALL tiddlers when the search input is 
blank.
* The <<list-links>> macro shows a bullet list using the combined 
title/text search filter, and also automatically excludes the temporary 
tiddler that holds your search input text.
* Because the custom search uses a separate tiddler to store the search 
text, you CAN search for text containing square brackets, as it avoids 
conflicting with the surrounding filter syntax.
* If you add the tag "$:/tags/SideBar" to your custom tiddler, it will 
appear as an extra tab in the sidebar, allowing you to quickly invoke the 
custom search at any time.

enjoy,
-e
Eric Shulman
TiddlyTools.com: "Small Tools for Big Ideas!" (tm)
InsideTiddlyWiki: The Missing Manuals

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/eea03f4d-5cd0-40d8-b890-522f944562ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to