Search doesn't always search the bodies notes

Hi, when I first load noteself and type a search it won’t always search the body of a post. So if I search for “bob” nothing will come up. But if I first search for “Co-workers” (which is the title of a note) then click on it, it will load the “Co-workers” note which has “bob” in the body. Now when I search for “bob” the “Co-workers” note will come up. So I have two questions: Is this expected and is there a way to load all notes so that search will search all of them.

Yep, that is a known side effect of asynchronous loading and lazy tiddlers.
Basically what tiddlywiki does for synchronisation is loading every tiddler without the text (AKA body) field, which is, typically the bigger one.
The first time you open that tiddler, the tiddlywiki ask the server for the text field and it gets loaded. This is why it is called lazy, because it does not loads the entire tiddler until it is strictly necessary.
When you search, it search on all the tiddlers but because some tiddlers do not have a text field yet the search will not match, then you open the tiddler, the search will match.

This can be partially fixed by adding some other fields with keywords for search.
Let me know if this is too problematic for you.

1 Like

It does greatly restrict the usefulness of the software for me. Is seems like it would be possible to have the search functionality built-in to the server, although perhaps it would be necessary to install something like https://github.com/rnewson/couchdb-lucene (and then write a tiddlywiki plugin that will hook into the search).

Well, I understand that it can be frustrating.
The problem here is that we have to very important limitations:

  • couchdb is not very good for text search
  • tiddlywiki search is 100% synchronous and does not have a mechanism to rely on a server search

Of course with enough time and effort everything can be achieved, but I’m not sure how good the result will be.

Might a quick and dirty fix be to have a button for loading all tiddlers’ bodies?

Yes, that will be a dirty fix, but will work.
It doesn’t need anything fancy, you can even do that with just plain tiddlywiki syntax.
I’m not sure about the details now, but shouldn’t be hard, but I’m not sure about how it will perform.

Well, I just remembered that there is a button that does that already. When you click the download button, in order to allow you download a complete wiki all tiddlers are load into memory, so that can be used to make accurate searches.

Will that workaround help you @axelson?

Ah, that does work well for me for now. Although the constantly spinning favicon was annoying, but it looks like I can press the stop button afterward which fixes that.

(This may have been noted elsewhere.)

The current https://noteself.org/online/ with TiddlyWiki version: 5.1.21
has this new option box at the top of $:/ControlPanel -> TiddlyPouch tab

Use fat tiddlers

Usually tiddlers are loaded on a lazy fashion, meaning that initially the text field is ommited and when the tiddler is open then the text field is loaded. Checking this will change that and all the tiddlers will be fully loaded upfront.

Hey @willwray, I’m glad you found that option!
I added that feature to help some plugins like tiddlymap and others that depends on tiddler content to work better, but I didn’t have any success making those work. I’m glad you found another usage! A feature that is discovered by the end user is always a good thing.
It’s true that I didn’t announced it here on the forum, just on the issue trackers of the project.