In some delightfully hard-to-find MS Documentation, there's information regarding several string-specific query operators. One of them is COP_VALUE_STARTSWITH
:
Operator: COP_VALUE_STARTSWITH
Symbol: ~<
Example: System.FileName:~<"C++ Primer"
Description: Finds items where the file name begins with the characters "C++ Primer".
So, to find only files that begin with "1-
", use:
FileName:~<1-
Other operators include:
- COP_VALUE_ENDSWITH:
~>
- COP_VALUE_CONTAINS:
~=
or ~~
- COP_VALUE_NOTCONTAINS:
~!
- COP_DOSWILDCARDS:
~
VALUE_CONTAINS
overcomes the default word-based (as opposed to character-based) nature of Windows Indexing. Using name:~~cess
:
DOSWILDCARDS
allows the wildcard characters ?
and *
to be used in quoted strings. And characters that are part of seach syntax, such as (
, )
, [
, and ]
, must be in quotes to interpreted as search characters. So to find files that have parenthetical indices at the end of the filename, use FileName:~"*(*).*"
Again, the complete list is here:
Using Advanced Query Syntax Programmatically - Query Operators