Search for a phrase

Hello,

I created two tiddlers:

  1. with Phrase - content: This is a test.
  2. without Phrase - content: This is a good idea, to test it.
    phrase.json (370 Bytes)

If I search for “This is a test”, both tiddlers are listed.
It would be very nice to have a checkbox etc. to activate search term with exact match at that level - like Context plugin does. It also should be listed on top position of results.

@telmiger: could that be an option in your plugin “Simple Search”?

Thanks
Stefan

1 Like

There are some discussions here at Talk, that discuss how we could improve the search behaviour. But there are no solutions yet.

and

Perhaps the better option would be if we introduce to the standard search the ability to force a phrase by simply quoting it “This is a test” which would then make use of the search operators “literal” parameter
eg: {{{ [all[tiddlers]search::literal[This is a test]] -[<currentTiddler>] }}}.

The out of the box way to extend search is to use Customising search results

  • I built this for you, place you This is a Test in the sidebar search and click the down arrow, then the Search as Phrase tab.
  • In this case you don’t wrap it in quotes, the whole search is the literal string.

Custom Search as Phrase.json (426 Bytes)

This is so easy to do I made more to use with Projectify.

@TW_Tones - literal search was a good hint - thanks.

I was able to implement it also in “Simple Search” Plugin:

1 Like

Interesting, could you send me some hints or a link so I can see how you did that?

Cheers, Thomas

I imagine he used a version of the search operator with the literal parameter as in the example I shared;

Hello @telmiger,
I created that tiddler (with some style):
$__plugins_telmiger_simple-search_SearchResultsPhrase.json (654 Bytes)

and add it to

Greetings
Stefan

1 Like