Page 1 of 1

Clarification on 'contains' vs 'contains match'

PostPosted: Wed Jan 31, 2018 2:40 pm
by ChrisJenkins
I routinely have issues where 'Contents - contains' does not find text in my searchable PDF files even though Spotlight shows the word(s) as being there and they even show as there in Hazel Preview. In these cases 'contains match' generally seems to work.

I'd just like definitive confirmation that 'Contents - contains' exclusively uses Spotlight while 'Contents - contains match' does not use Spotlight? This seems to have been alluded to in other posts and answers. Also, if 'contains match' doesn't use spotlight, how exactly does it work? Does it just perform a pattern matching scan through the entire file? In that case how does it handle different character sets/representations (or maybe it doesn't)? Just curious :-)

Thanks.

Re: Clarification on 'contains' vs 'contains match'

PostPosted: Thu Feb 01, 2018 11:24 am
by Mr_Noodle
"contains" uses Spotlight. A test is to search for the term in Spotlight and see if the file comes up in the results.

"contains match" does pattern matching directly on the file contents. Not sure what kind of issue you mean with character sets though. Can you elaborate?

Re: Clarification on 'contains' vs 'contains match'

PostPosted: Thu Feb 01, 2018 11:45 am
by ChrisJenkins
Thanks for clarifying. I'm petty sure that 'contains' sometimes fails even though Spotlight has indexed the file and the search term is in there. If I find a confirmed case I will let you know.

When I said 'character sets' I should have really said 'character encoding'. There are lots of potential character encodings that may be used in documents from various sources; Unicode (UTF-8, UTF-16, ...), ISO 8859 and all its variants, Windows-125x and so on. I was curious how (or even if) Hazel's 'contains match' functionality deals with files that may have different character encodings. Maybe it isn't even an issue; I haven't found any actual problems, it was more out of curiosity.

Re: Clarification on 'contains' vs 'contains match'

PostPosted: Fri Feb 02, 2018 11:22 am
by Mr_Noodle
If you find a case where it doesn't work then let me know.