|
Posted by Chung Leong on 10/20/66 11:56
sutton128@yahoo.com wrote:
> I just came across this and it is spectacular. It works great and
> makes using the indexing service to handle the heavy lifting of
> searching a breeze. Thank you.
>
> Is there anywhere to find more advanced examples like boolean searches,
> use of wildcard characters, or searching across multiple file
> attributes.
I'm not really an expert in Indexing Service. Here's something I just
came across:
http://www.unis.no/Search/ixqLang_UNIS.Htm
The query string described in the document goes into CONTAINS()
statement. I realize now that what I said about the double quoted
strings was wrong. It's used for searching multiple words in a sequence
(i.e. a sentence). You can use the prefix* syntax without the double
quotes.
To look specifiy multiple criteria, you just join them together in the
WHERE clauses as you would when querying a database.
Example:
SELECT path, filename, size, write
FROM SCOPE()
WHERE CONTAINS(contents, 'love AND NOT sex')
AND size > 10240
AND write > '01-01-2006'
ORDER BY size
The statement above looks for files containing 'love' but not 'sex',
that are larger than 10K and modified some time this year, and lists
them from the smallest to biggest.
To do a wildcard match against the filename, you use the LIKE
'%pattern%' syntax.
Example:
SELECT path, filename, size, write
FROM SCOPE()
WHERE filename LIKE '%.mp3'
This statement looks for files with the .mp3 extension.
[Back to original message]
|