[xplorer˛] — Advanced text search in files
home » blog » 2 December 2007
play flash demo


"Man with one chopstick go hungry" — not Confucious, surely?

Google is now so big that "googled" has entered the vocabulary as a verb. I googled for information. Its keyword based text search on the other hand is not how we used to search for text, nor is the best. When you start typing keywords The Google assumes that you want something that approximately matches all keywords, which means a document that contains all these words. Punctuation, spaces and other special symbols are ignored. Most importantly as we've seen before, google cannot find text in the middle of a word, e.g. fetch documents that contain dislocate when you search for locate.

The text search in xplorer˛ on the other hand is how you would normally search for text within any text editor like MS Word or Adobe Reader. You enter the exact text you want to search for: one fish will only match files that conain these two words in sequence e.g. as in gone fishing. You won't find files that contain "one big fish". Spaces are just like any other character. If you type two spaces it means you are looking for two space characters etc.

xplorer˛ can do google-like keyword search in files but it will require some special query syntax, using the comma character to separate keywords and a plus symbol before each one. If you search for +one,+fish, the comma and the white space around it are not literal, it just splits the search google style. The leading + makes sure both keywords exist, in any order. So that's exactly google style search with 3 extra characters in the query string.

The language is slightly more complicated, but it is more expressive. Using leading + and - (minus) you add boolean context to the following keyword: + means AND (must be present) and - means NOT (mustn't be present). If neither +/- are specified, boolean OR is assumed. If we drop the pluses from our example above (one,fish) then we are looking for either "one" or "fish". Files that contain either one (not necessarily both) will be flagged.

There are many more options on offer, like case sensitivity (difference between One and ONE), word boundaries, text file encoding, even regular expression support. That's too much information for a weekly blog so I would recommend having a look at the online manual for more information.

Finally, what if you want to search for a literal comma in a file? All these special characters can be escaped. The easiest way is to put two commas in a row, ,, will match a single comma. The boolean + and - are only considered special at the beginning of a keyword so they won't be cause for much concern. If you want to escape them, add a second +, e.g. ++ will search for a literal + and +- will look for - (minus). Or just check the Verbatim box in the search text dialogs (either Mark | Containing text or Tools | Find files menu commands) to disable all special processing.

More boolean tricks in today's text search demo

Post a comment on this topic

AddThis Social Bookmark Button

 

 

What would you like to do next?

Reclaim control of your files!
  • browse
  • preview
  • manage
  • locate
  • organize
Download xplorer2 free trial
"This powerhouse file manager beats the pants off Microsoft's built-in utility..."

download.com
© 2002—2007 Nikos Bozinis, all rights reserved