Jump to content

Search a file content of markdown document through File Filter


Recommended Posts

Hello, 

 

I created a workflow which search a file name and content of a folder for nvALT application's markdown and text documents through File Filter object. 

But, it doesn't show a right result that I expected. 

 

There are several symptoms that I noticed. 

 

- When I search a keyword on nvALT , it shows a right result. 

- When I search a keyword on Alfred with the workflow , it doesn't show a same result above. 

- When I search a keyword on Finder , it is same like using Alfred's workflow. 

- I tried to re-index Spotlight. But, it is still same. 

 

27590969580_eea9d5ec75_b.jpg

 

27590969680_c3a8824670_b.jpg

Edited by wowgowow
Link to comment

Alfred uses the same index as Spotlight (and Finder etc.), so the results are going to be substantially similar.

 

If you think Markdown files aren't being searched/indexed properly, that's something to take up with either Apple or whoever wrote the Markdown search plugin.

Link to comment
  • 2 weeks later...
That's unrelated to Spotlight and indexing.
 
mdimport is your friend. Here's (some of) what my machine shows for a Markdown file:
 
mdimport -d2 rTorrent.md
2016-07-08 17:57:45.456 mdimport[86103:3591746] Imported '~/Dropbox/Documents/Text Files/rTorrent.md' of type 'net.daringfireball.markdown' with no plugIn.
2016-07-08 17:57:45.458 mdimport[86103:3591746] Attributes: {
    ...
    ...
    kMDItemContentType = "net.daringfireball.markdown";
    kMDItemContentTypeTree =     (
        "net.daringfireball.markdown",
        "public.text",
        "public.data",
        "public.item",
        "public.content"
    );
    ...
    ...
    kMDItemKind =     {
        "" = "Plain Text";
    };
}
 
As you can see, there is no Markdown importer. The system treats it like a plain text file.
 
It may or may not be set up the same way on your system.
 

 

The bottom line is you're probably never going to get the same results from Spotlight/Alfred as from nvAlt because they're using different search engines.
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...