Field search with Tiddlywiki Indexer

Hi Tiddlywiki users,
I’m trying to use the Tiddlywiki Indexer (Tiddlywiki Indexer — create subject/author indexes) and would like to try searching not only in the text of a tiddler but also its field values. At the moment while testing it seems to search the text only!
Is there a way to make it search the field values too?
Thanks for taking note of this question!
Regards,
Gerard

I haven’t used Indexer, but https://kookma.github.io/TW-Indexer/#doc%2Fmake-index-ui shows the macro for creating an indexer as taking a fields argument:

<<macro-index 
  scope:"[all[tiddlers]!is[system]]" 

  fields:"title,tags,caption"

  entriesTiddler:"" 
  stateTiddler:""
>>

Of course this doesn’t allow you to specify “all fields”, but it might be helpful.

1 Like

Hi,
Thank you Scott_Sauyet; does this mean that I’ve to edit this macro manually? I don’t see any settings that might enable me to add some fields to the search.
Regards,
Gerard

Hi,

Tried to add a new author index by following the tutorial of the Indexer like so:

Created a tiddler (title: Author Index Add) with following content:

{{author||$:/plugins/kookma/indexer/macros/add-entries}}.

This renders OK!

Next I added a tiddler (title: Author Index) containing:

<<make-index scope:"[all[tiddlers]!is[system]]" fields:“title, text” entriesTiddler:“author” stateTiddler:“authormp”>>

This last tiddler renders nothing at all; so what am I doing wring here?

Regards,
Gerard

Did you add some authors’ names to it?

You can call the macro like this:

<$macrocall $name="make-index"  
   scope="[all[tiddlers]!is[system]]" 
	fields=`${[all[tiddlers]!is[system]]+[fields[]]+[join[,]]}$`
	entriesTiddler="subject"
	stateTiddler=""
	/>

to use all fields within the scope as long as none of your fields have spaces in them.

Note to @Mohammad , the documentation has us calling <<macro-index , which I think should be make-index .

Hi Mark_S,

I added the following entries to the add-entries tiddler: Piet under letter P and Author under letter A.

Next I added a tiddler with title Piet and the sentence: Author test for Piet, in the text field.

So I guess this tiddler should be shown by make-index; but nothing is shown?!!

I checked the $:/indexer/data/author tiddler and it contains Author Piet.

I use TiddlyWiki 5.3.6 and Indexer 0.7.0!

Regards,
Gerard

Be sure to put

\import [[$:/plugins/kookma/indexer/macros/make-index]]

at the top of the tiddler where you’re calling make-index.

Also, I don’t know if this mistake is in your original, or if Discourse did it, but some of the quotes in the code that appear here are not true double-quotes. So make sure all double quotes are real keyboard double-quotes.

Thank you. I opened a ticket to correct this.

Hi Mark_S,

That was indeed the solution to the problem; I missed the import! Now it’s working as expected.
Mohammad thanks for paying attention to this issue, and the correction.

Regards,
Gerard

1 Like