zimsearch icon indicating copy to clipboard operation
zimsearch copied to clipboard

Python 3 support and search by name instead of full text search config option, allowing full search with zim: prefix

Open shanness opened this issue 3 years ago • 7 comments

Fixes #14 #15 and #13

shanness avatar May 07 '22 20:05 shanness

@shanness where have you been all these years? :) Can't wait to test it out, but I'm not sure how to install it on Ubuntu. Can you give a simple instruction?

Oh, I see that you have your own repo https://github.com/shanness/zimsearch with your tweaks. Will go through the installation recommendations and report back.

sojusnik avatar May 08 '22 17:05 sojusnik

Installed the plugin with your tweaks!

That's what I did:

cd ~/.local/share/zim/plugins git clone https://github.com/shanness/zimsearch.git cd zimsearch sudo pip install .

The first thing that stood out is that your plugin works only when Zim is already open. That's somehow confusing, because you normally would expect it to work even when Zim isn't running, at least this was the case with the previous version. I've already had the case that Zim was closed and I started to type the page title in Gnome's shell search, but it didn't appear, because Zim was closed.

Then I tried the full text search feature with zim:testing expecting to find testing in my notes, but it only created a new page called testing.

Maybe it would be more intuitive to use zim:testing for a full text search and create a new note, when the normal search, that is looking for a page title, isn't finding results, like described here?

Happens ob Ubuntu 21.10 with Zim 0.74.3-SNAPSHOT-t202204171730.

sojusnik avatar May 08 '22 19:05 sojusnik

Hi @sojusnik, it's working for me. If I do zim:testing, I get new page for about 20 seconds then the search results. I have about 900 page, perhaps you didn't wait long enough or have much more data to search? I also tested that it offer's a new page if nothing found (for both zim:blah and just blah).

Basically my HD goes crazy with zim:testing, so perhaps just wait till your CPU/IO spike goes down?

image

shanness avatar May 28 '22 14:05 shanness

BTW, this isn't my plugin, I've just patched it. And also did you configure it to search only names by default (overridden with zim: which I've added a note in a later commit to the below option)

image

shanness avatar May 29 '22 11:05 shanness

Hi @sojusnik, it's working for me. If I do zim:testing, I get new page for about 20 seconds then the search results. I have about 900 page, perhaps you didn't wait long enough or have much more data to search? I also tested that it offer's a new page if nothing found (for both zim:blah and just blah).

It indeed does work … if I wait for about 10 seconds. Maybe showing an indicator that a full text search is performing wouldn't hurt, to avoid misunderstandings for new users.

BTW, this isn't my plugin, I've just patched it. And also did you configure it to search only names by default (overridden with zim: which I've added a note in a later commit to the below option)

Yeah. Because of your tweak, this great plugin is now usable again, but this issue still remains though:

The first thing that stood out is that your plugin works only when Zim is already open. That's somehow confusing, because you normally would expect it to work even when Zim isn't running, at least this was the case with the previous version. I've already had the case that Zim was closed and I started to type the page title in Gnome's shell search, but it didn't appear, because Zim was closed.

Nevertheless, thanks for updating it!

sojusnik avatar May 30 '22 13:05 sojusnik

Hey @sojusnik ,

It indeed does work … if I wait for about 10 seconds. Cool :) Maybe showing an indicator that a full text search is performing wouldn't hurt, to avoid misunderstandings for new users.

I've never written a search provider. But if you have any idea how I'd do that, happy to give it a go (I did a bit of a search and couldn't find anything). Have you ever seen another search provider show an indicator like that (I might be able to hack it from their source).

Yeah. Because of your tweak, this great plugin is now usable again, but this issue still remains though: The first thing that stood out is that your plugin works only when Zim is already open. That's somehow confusing, because you normally would expect it to work even when Zim isn't running, at least this was the case with the previous version.

Hmm, really? I didn't make any mods I don't think which should have changed that. I'm just really wrapping the search in "Name: *search* Name: *terms*" So no idea how that could have made it change if you needed zim running. You sure it worked in the version I forked?

I actually used a pile of code already written to migrate to Python 3. Maybe one of the other users patches broke that? https://github.com/vantu5z/zimsearch/compare/master...shanness:master#diff-7224c877cdb976eedc00f00cadca439d24b8672c5a5475fdd8a0ad9c07b58466L185

Nevertheless, thanks for updating it!

No worries :)

shanness avatar Jun 04 '22 05:06 shanness

I've never written a search provider. But if you have any idea how I'd do that, happy to give it a go (I did a bit of a search and couldn't find anything). Have you ever seen another search provider show an indicator like that (I might be able to hack it from their source).

Unfortunately, no. Don't know how to code either.

So no idea how that could have made it change if you needed zim running. You sure it worked in the version I forked?

I'm sure it worked without having Zim to run in the background in the previous release, before @achadwick did his tweaks and added the search functionality.

I actually used a pile of code already written to migrate to Python 3. Maybe one of the other users patches broke that?

Can't help you with that, sorry, this code looks like gibberish to me.

sojusnik avatar Jun 13 '22 09:06 sojusnik