zot / microfts

Small and fast FTS (full text search)
MIT License
32 stars 3 forks source link

multiple search terms only match when they are in the same line #4

Closed jkitchin closed 3 years ago

jkitchin commented 3 years ago

This may not be a bug. I use the default microfts input with no flags to index the files. The file one.org has the words "example" and "hashtag" in them, but not on the same line. So the first two searches below work where both words are in a single line. But the last one returns nothing, which was a surprise to me.

./microfts search -u ../cache/fts.db one example

+RESULTS:

: /Users/jkitchin/Dropbox/emacs/microfts/examples/one.org:3:This is the first example with a one in it.

./microfts search -u ../cache/fts.db one hashtag

+RESULTS:

: /Users/jkitchin/Dropbox/emacs/microfts/examples/one.org:7:And #one hashtag.

./microfts search -u ../cache/fts.db example hashtag
zot commented 3 years ago

Yes, input with no flags indexes by line.

If you want to index by org chunks, you have to supply the -org flag.

zot commented 3 years ago

Btw, microfts stores whether you used -org for input (or the empty subcommand) so update can properly reindex the file.

zot commented 3 years ago

Maybe add