Skip to content

Conversation

@jjw24
Copy link
Member

@jjw24 jjw24 commented Jul 12, 2020

Add file content search for Explorer plugin using Windows Index's own indexed content.

Customisable Action Keyword. Default is 'doc:'

Closing #118

@jjw24 jjw24 added the enhancement New feature or request label Jul 12, 2020
@jjw24 jjw24 self-assigned this Jul 12, 2020
@kalaschnik
Copy link
Member

kalaschnik commented Jul 13, 2020

I have not tried your changes; however, in my experience one cannot set Everything to index file contents which results in a very bad performance (i.e., naive search), compared to the instant-indexed results of Windows explorer search (either through start menu or file explorer search (starting in 2004 update). I demonstrated this by searching a string within a PDF in Windows Start Menu search and Everything (not even sure if Everything can search within PDFs):

Is there no way to use Windows Search for file contents? Would be cool to finally get rid of Everything as a dependency for searching stuff.

UPDATE from the Everything docs:

Does Everything search file contents?
Yes, "Everything" can search file content with the content: search function.
File content is not indexed, searching content is slow.
https://www.voidtools.com/faq/#does_everything_search_file_contents

@jjw24
Copy link
Member Author

jjw24 commented Jul 13, 2020

Oh, sorry i wasnt clear in the PR summary. This pr actually adds the windows index's content search. Explorer will use it to search for file content.

I was just asking only specifically how we want to trigger a file content search with explorer, at the moment I built the trigger like Everything plugin where you need to type 'content:' then your search to trigger it.

@kalaschnik
Copy link
Member

Ahh Sorry! Thanks for clarifying. I thought we re-introduce Everything here!

  • Would it be possible to trigger content search without any keyword, or would this decrease the performance too much?
  • Windows Search is using documents: {search string}
  • Windows Explorer is using {search string} kind:document, when explicitly selected by the user. Implicitly it searches any kind.

Anyway, I also would have a preference for content {search string}, since it is shorter. However, it would be neat (for later release) if the content keyword is customizable.

@jjw24
Copy link
Member Author

jjw24 commented Jul 13, 2020

Ahh Sorry! Thanks for clarifying. I thought we re-introduce Everything here!

  • Would it be possible to trigger content search without any keyword, or would this decrease the performance too much?
  • Windows Search is using documents: {search string}
  • Windows Explorer is using {search string} kind:document, when explicitly selected by the user. Implicitly it searches any kind.

Anyway, I also would have a preference for content {search string}, since it is shorter. However, it would be neat (for later release) if the content keyword is customizable.

All good.

I wouldnt want to trigger content search without a keyword, this doesn't have any drastic impact on performance as it is just pulling data already in the windows index, but it would make the results very messy. That's why I didn't do too much work on how to trigger the content search until if there is any feedback.

@jjw24
Copy link
Member Author

jjw24 commented Jul 13, 2020

Updated PR summary to make it clearer

@JohnTheGr8
Copy link
Member

we can use a shorter keyword like doc: for convenience

@kalaschnik
Copy link
Member

we can use a shorter keyword like doc: for convenience

+1 for doc:, yet in a later release this should be user adjustable.

@kalaschnik
Copy link
Member

I would propose in:, this is also what Mac’s Alfred is using, and it is really short :)

When you need to expand your search scope beyond these core file types included in Alfred's results, the File Search keywords are here to help you.

Use the "open" keyword to open a file (or press the spacebar as a shortcut!)
Use the "find" keyword to reveal the file in Finder
Use the "in" keyword to search inside your files' content
https://www.alfredapp.com/help/features/file-search/

@jjw24
Copy link
Member Author

jjw24 commented Jul 14, 2020

I am making the action keyword customizable.

It's going to be triggered like how you would trigger a plugin.

I think content makes more sense but is too long, doc or in kind seems a bit confusing for an action keyword ?

{
var settings = Plugins[metadata.ID];

// TODO: Remove. This is one off for 1.2.0 release.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a note here, this is a one off, and will be deleted in the next release. It is needed as we introduced an additional action keyword.

I have also introduced version in plugin settings in the following commit to lay the ground work for handling future plugin meta updates.

@jjw24 jjw24 requested a review from gdziedzic July 19, 2020 12:31
@jjw24
Copy link
Member Author

jjw24 commented Aug 13, 2020

As part of this change, I am also thinking about changing the Explorer trigger hotkey currently global "*" to "e". This will only trigger Explorer search when the users choose to do so with "e". This will reduce the numerous results from Explorer currently with any searches that the users perform, reduce the unnecessary clutter of results. @Flow-Launcher/team

What do you think?

@kalaschnik
Copy link
Member

kalaschnik commented Aug 15, 2020

Would that mean searching files and folders only gets triggered when typing e before?

@jjw24
Copy link
Member Author

jjw24 commented Aug 15, 2020

Would that mean searching files and folders only gets triggered when typing e before?

Yep

@kalaschnik
Copy link
Member

kalaschnik commented Aug 15, 2020

I’m not sure about that actually. Right now—in Flow Launcher—I do not need to enter a keyword to search for files and folders. More recently I was using Alfred (changed work), and it bugged me a lot that its default settings would only search preferences and contacts. However, most of the time I want to find stuff (i.e., files and folders). So for Alfred, I clicked the checkboxes under Extras:

image

I would propose that Flow Launcher should search for files and folders without a keyword by default. What do the others think @Flow-Launcher/team ?

@JohnTheGr8
Copy link
Member

Either way is okay with me, it's simple enough to change to one's liking...

@jjw24
Copy link
Member Author

jjw24 commented Aug 16, 2020

Fair enough, I will just leave it how it is.

Copy link
Member

@JohnTheGr8 JohnTheGr8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work! 👍

@jjw24 jjw24 merged commit 87ae60d into dev Aug 17, 2020
@jjw24 jjw24 deleted the add_filecontent_search branch August 17, 2020 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants