Advanced Search in Fields Plugin: New Updates

Advanced Search in Fields

As explained in Ref [1] below, Search in Fields adds a new tab in $:/AdvancedSearch, lets you to search in an individual field or in all fields.

For the first time a sortable dynamic table displays the output in advanced search. Search in Fields also let you to use regex to make powerful search.

For more details see [1].

Code and demo

Please do not forget, for tabular output you need to have Shiraz installed on your Tiddlywiki. The simplest way to install is to have Kookma Plugin Library!

If you like it please star it at GitHub - kookma/TW-Search: Advanced search in fields using regular expression and tabular output

Screencasts

Search in fields

Customize outputs

Plain output

References

[1]. Advanced Search in Fields Plugin: First Experimental Release

3 Likes

Ciao @Mohammad

Minor cosmetic issue on chrome …

I’ll write later about the functionality.
TT

Ciao @Mohammad. The Regex function is great…

Screenshot 2022-01-07 152234

Fundamentally it solves the issue in live search of being able to use full regex syntax. It gets round the problem of using regex “[Character Classes]” that aren’t compatible with the standard TW filter syntax. By allowing them you liberate freed search via regex.

Hats off!
TT

1 Like

Ciao @Mohammad

This returns nothing much …

I was expecting it to return all tiddlers with an “$”. Maybe the tool needs a switch for that? IMO, for regex, all tiddlers should be exposed to it.

Hi TT,
This is a strange issue! I am not sure, but it seems TW 5.2.1 does not put the css at the end of list when building the stylesheet!

Simple solution

To resolve this do as below

  • Open $:/ControlPanel > Info > Advanced > Stylesheet
  • Next move $:/plugins/kookma/search/styles/style.css which is at the top of list to below $:/themes/tiddlywiki/vanilla/base
  • To do step ii, you now you can open $:/themes/tiddlywiki/vanilla/base click on the tag pill ($:/tags/Stylesheet) and change the order!

The reason is the search scope now is limited to [!is[shadows]!is[system]]
I am thinking let users simply decide on search scope!

To change this

  • open $:/plugins/kookma/search/macros/definition
  • change the search scope
1 Like

Ciao @Mohammad … regarding the styling …

Yeah it is strange! FYI, inside Advanced Search (at the moment) the layout breaks but the actual Field Search tiddler alone has the correct layout, like this …

Very confusing!

I definitely think this needs to work well out-of-the-box if at all possible!

Best TT

Ciao @Mohammad

ON SCOPE

Right! I definitely think that a way to set the scope from the interface for the regex component is a very good idea. It is only the scope that is outside the regex itself?

I do think a dropdown of the common needs on “scope” is a good idea! What do you think?

Best wishes
TT

In $:/themes/tiddlywiki/vanilla/base, there is this definition:

.tc-advanced-search input { width: 60%; }

which, in addition to affecting the size of text input fields, also affects radio and checkbox inputs.

To correct this, you can create a stylesheet tiddler (tagged with $:/tags/Stylesheet), containing:

.tc-advanced-search input[type=radio] { width: auto; }
.tc-advanced-search input[type=checkbox] { width: auto; }
2 Likes

Ciao @Mohammad

This is more a question than an answer!

DOES THE USER NEED DOCS FOR THE REGEX COMPONENT?

This relates to the regex component only. The syntax of regular expressions is quite different than standard TW filters. What I am wondering is if the regex part needs documentation of how to optimise use of regex?

Obvious issues are …

  • The use of regex [Character Classes] is incompatible with standard TW filters—and that needs explaining?

  • Understanding how to use regex flags. The TW regexp Operator supports the i, g & m flags. I think explaining how to use them, and what they do, via the tool would be a good idea? [e.g. prefix (?ig)]

Not sure.
Thoughts
TT

1 Like

Hi TT,
I reported this in GitHub! The reason is the wrong stylesheet ordering!
The solution is just reorder the $:/plugins/kookma/search/styles/style.css now is called $:/plugins/kookma/search/styles/main

1 Like

Hi Eric,
Thank you for the hint!
By the way it is strange the plugin stylesheets appear before core $:/themes/tiddlywiki/vanilla/base!

1 Like

Advanced Search in Fields has got update v0.3.0 (Experimental)
The major changes here

  • customizable search scope,
  • multi fields search

Code and demo

Do not forget to to have Shiraz installed on your Tiddlywiki.

Debug info

1 Like

Whoah! That is brilliant!

TT

1 Like

COSMETIC ISSUE IN THE SHIRAZ VERSION

Caro @Mohammad, the tabular format is great! But sometimes is breaks neat display when wide. For example …

I think you can restrain tables by wrapping them in a div that controls overflow and add scrolling?

UPDATE: Or, maybe, just make the table background colour white?

Just comments.
TT

I think it worth commenting why your approach in the regexp mode is so useful. Here is just one example …

The Use Case: Understand better how editor buttons work.

Basically, field search via regex in your tool, lets you probe TW is a very efficient way to solve practical problems! In the use case I needed to know which buttons used which fields.

I hope more people than me give you feedback!

For myself I will likely add this tool to every wiki I work on. It is compact and to the point!

Best wishes
TT

1 Like

That’s fair. But my issue is time. I have my own pile of “confusion and doubt” to contend with so I’m waiting for a more stable release before I jump in.

I’m not really moaning per se. I do understand time constraints. But also, actually, the numbers of people active here with interest/competence to give useful feedback is actually quite limited compared to larger communities. There are not that many people optimally placed.

It is just, occasionally, something comes along where one’s feedback helps a bit to shape it. I particularly like commenting to @Mohammad because he really listens to feedback.

Just a comment
TT

1 Like

Very true. Probably the most active (maybe even the most prolific) developer of TW extensions (plugins, code snippets) currently operating. Kudos to him (@Mohammad)

3 Likes

Hi TT,
solved in v0.4.0! Than you for reporting this!

1 Like