all groups > sql server full text search > july 2007 >
You're in the

sql server full text search

group:

Syntax Question: Query by File Extension


Syntax Question: Query by File Extension Jack
7/12/2007 12:00:00 AM
sql server full text search:
In my catalog of photos the following query returns all jpegs
(correct):
#filename *.jpg
And this returns 1 result (correct)
#filename *.jpeg
However this returns nothing (incorrect):
#filename *.|(jpeg|,jpg|)
....unless I add another filename query (correct):
#filename *.|(jpeg|,jpg|) AND @filename "bikes"

Why does it not want to filter multple file extensions?
Re: Syntax Question: Query by File Extension Hilary Cotter
7/12/2007 12:00:00 AM
I think this is an indexing services question. In this case you need to set
AllowEnumeration=true and do the following:

set objQuery=CreateObject("Ixsso.query")
objQuery.Query="{prop name=FileName}{regex}"& chr(34) & "*.|(jpeg|,jpg|)" &
chr(34) &" {/regex}{/prop}"

objQuery.Columns="FileName,vpath, write"
objQuery.MaxRecords=300
objQuery.AllowEnumeration=-1
set objRecordSet=objQuery.CreateRecordSet("nonsequential")
while not objRecordSet.Eof
wscript.echo objRecordSet.Fields(0) + " "+objRecordSet.Fields(1) +"
"+CSTR(objRecordSet.Fields(2) )
objRecordSet.MoveNext
wend


--
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
[quoted text, click to view]

Re: Syntax Question: Query by File Extension Jack
7/12/2007 12:00:00 AM
[quoted text, click to view]
I'd maintain that the behaviour is inconsistent but you are correct
AllowEnumeration=true solves the problem. My concern is that this
option is a performance hit which is only really necessary in certain
obscure cases.
Re: Syntax Question: Query by File Extension Jack
7/12/2007 12:00:00 AM
[quoted text, click to view]
Looks like I'll have to do:
If InStr(Query, "#")>0 And InStr(Query, "@")=0 Then Q.AllowEnumeration
= True
for optimal performance
Re: Syntax Question: Query by File Extension Hilary Cotter
7/12/2007 11:56:03 AM
Not really. Indexing services is designed to provide web and file system
indexing. You are telling it with the @ query look only in indexed
documents. By default if you are looking for file system properties it
consult the index, if you want a complete list it will do the grep only if
allowenumeration is set to true.

--
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
[quoted text, click to view]

AddThis Social Bookmark Button