Share via

Windows 7 Explorer Search Boolean

Anonymous
2013-06-03T18:05:08+00:00

I am using a Windows 7 computer in which almost all of the file names have no spaces. I'm trying to figure out what the best way to search for documents in Windows Explorer would be. Most of the file names are set up this way: FileNamingGuidelines or BODMin_2010-01-12 or EE_ExpReport_2010. My question is essentially, what would be the best way to search for documents on this computer? I was thinking of using Boolean search operators to search for keywords, since most files don't have spaces. 

One of my ideas to find FileNamingGuidelines was to search for: *file* AND *nam* AND *guideline*


When I do that, however, nothing comes up. I am unsure what I am doing wrong and how exactly Windows 7 search interprets Boolean operators. I have come across some difficulties with the way Windows Explorer reacts to wildcard searches using * and ?. Any suggestions?

Thanks!

Windows for home | Previous Windows versions | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

24 answers

Sort by: Most helpful
  1. Anonymous
    2013-06-04T04:49:48+00:00

    You can make use of MS's Advanced Query Syntax.  The symbols ~= mean "match anywhere in the searched property", and so you wouldn't use wildcards at the same time, as in:

    name:(~=file ~=nam ~=guideline)

    The AND is inferred by default and not necessary to specify.

    Now if you need to use wildcards, then the ~= symbols won't work.  When we want to specify a searched property such as name, we are restricted to ~ alone which means "match exactly", so we have to place * at start and end of text that could appear within text, if used in conjunction with the name property, as in:

    name:(~*min?20*)

     [Curiously, the similar property filename: can search with wildcards without use of ~, as in filename:*min?20]

    By the way, = alone also means "match exactly", but when used with the name property, wildcards won't work.

    4 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2013-06-05T06:57:10+00:00

    The Windows 7 search syntax is called Advanced Query Syntax.  It uses many symbols and a few words as operators to give some flexibility and specificity to searches.  Here is a summary of the operators:

    ( ) parentheses:  search operators and text that is placed within parentheses is taken to belong to the search property immediately preceding the opening parenthesis.  For example, name:(cat man) gives results whose name contains words (or other text strings) that are or begin with both cat and man (but not merely either).  Parentheses can also be used to affect priority of special words AND, OR, and NOT as described later in these notes.  It is ineffective to place special search syntax symbols (=, ~=, and others described in the next few paragraphs) immediately before search text that is within parentheses, as the search results given are the same as would be there if the symbols were not used.  For example, instead of entering name:=(buns), enter name:(=buns), or since with a single word of search text the parentheses are optional, enter name:=buns.

    " " quotation marks:  By default, the “Find partial matches” setting is active (in the Folder Options dialog box, Search tab), which means that results include items with words that begin with the characters of the search text.  If quotation marks are placed around the search text, then the effect is the same as deactivating that setting, and the results only include items with words that are the same as the search text.  (Some special syntax described later can override the effect:  ~, ~=, ~!, ~<, ~>, and $<.)  When quotation marks are placed around two or more strings of text (words) separated by spaces, by default Windows 7 Search treats the strings as a list.  So, for example, name:"one two three" finds items whose names contain every string in the list, in any order.  [Update:  bizarrely, the mostly equivalent property called "filename" does enforce order, actually, while "file" and "name" do not.]  The quotation marks are not sufficient to treat the list as a single string (or phrase), when searching most properties.  Treating the list as a single string requires special syntax symbols (=, ~, ~=, ~!, <>, >, <, >=, <=, ~<, and ~> work, but $< and $= do not) to precede the first quotation mark.  Unfortunately, none of the working syntax symbols allow searching for a phrase that appears anywhere in the property text except for ~=, and ~= includes items that have other text immediately before or after the search text.  For example, content:~="goose pimple" would include items whose content text had “bgoose pimpleq”.  If only content with “goose pimple” as a distinct phrase was desired, then to get results closer to that desire (but not completely successfully), enter content:(~="goose pimple" "goose pimple").  That search would, however, include items that did not have the distinct phrase but instead “bgoose pimpleq” if the content text also had separate instances of “goose” and “pimple”.  If instances such as "bgoose pimpleq" are not considered  to be a problem, then it is sufficient to enter content:~="goose pimple".  [Update:  apparently special search symbols such as ~= don't work with the content property when searching in indexed locations, but do work when searching in non-indexed locations.]

    With the use of special syntax symbols, quotation marks also allow searching for non-alphanumeric symbols that otherwise would not be searchable, as described in the section titled “How to search for symbols or text containing symbols (non-alphanumeric):” later in these notes.

    3 people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2013-06-05T06:45:32+00:00

    You are welcome.  Now as to why ~=file ~=nam ~=guideline wouldn't do the trick for you, I don't know -- a quick test I did with something similar seemed OK.  But I have decided not to rely on searching without specifying the property that I am searching for anyhow, as there do seem to be quirks related to indexing or settings that are not obvious.

    [update:  apparently special search symbols such as ~= don't work if the name property is not specificed when searching in indexed locations, but do work when searching in non-indexed locations regardless.]

    As for searching for optional terms, the word OR in capital letters works, and you can use the name property more than once, as in:

    name:(~=file OR ~=doc) name:(~=guideline OR ~=rule)

    which would find files with names having either of file or doc while simultaneously having either of guideline or rule.  You can use multiple brackets instead for the same effect:

    name:((~=file OR ~=doc) (~=guideline OR ~=rule))

    About resources out there about such searching, I didn't find any single one that satisfied me, and so I spent a few months looking at those resources, trying stuff myself, and made a lot of notes that I refer to instead.  I'll dump some of that here now.

    2 people found this answer helpful.
    0 comments No comments
  4. Anonymous
    2014-07-14T06:36:43+00:00

    Hi!

    I like to be able to search for

    =

    (Equal)

    since I have that in some filenames.

    How do I do that in Win Explorer?

    (Win7-64bit)

    The files are namned like:

    myfile=.avi

    /GS!

    1 person found this answer helpful.
    0 comments No comments
  5. Anonymous
    2013-06-05T06:59:29+00:00

    AND:  The word AND is a redundant feature, because simply entering search terms together is effectively performing the function of AND.  For example, name:(we AND bu) gives the same results as name:(we bu).  For another example, name:bit AND ext:.doc gives the same results as name:bit ext:.doc.  The word AND is only interpreted as search syntax when the letters are all uppercase (capitals).  A space needs to follow AND for it to work, unless it immediately precedes text in parentheses or quotation marks.

    OR:  The word OR allows for searching for alternative search terms with the same search property, and also allows for searching with alternative search properties.  For example, tag:(beach OR pool) gives results whose tag properties have either (or both) the words (or starts of words) “beach” and “pool”.  For another example, foldername:=gong OR path:clang gives results that are immediately within a folder named “gong” or have a path that has the word (or start of a word) “clang” somewhere.  The word OR is only interpreted as search syntax when the letters are all uppercase (capitals).  A space needs to follow OR for it to work, unless it immediately precedes text in parentheses or quotation marks.

    NOT:  The word NOT has the same effect as the minus sign described earlier.  The word NOT is only effective as search syntax when the letters are all uppercase (capitals).  A space needs to follow NOT for it to work, unless it immediately precedes text in parentheses or quotation marks.  Otherwise, the usage requirements of NOT match those of the minus sign, such as requiring parentheses around search text when used immediately before search text that uses special syntax symbols, as in name:NOT(~<g).

    AND, OR, and NOT:  When more than one of these words is used (or the same word is used more than once), Windows Search interprets the priority as though search terms were within parenthesis from left to right.  For example, filename:blue NOT ext:.txt OR content:blue AND size:<100kB is interpreted as ((filename:blue NOT ext:.txt) OR content:blue) AND size:<100kB.  To change the priority, the search properties can be reordered or parentheses can be placed elsewhere as required to have the desired search performed.

    1 person found this answer helpful.
    0 comments No comments