Index Search...
-
Can we use the SUBSTRING in Index Search select Query... ie Something like the below.. cmdSearch.CommandText = "select Vpath, path, FileName, size, write, attrib, SUBSTRING(Characterization,90,DATALENGTH(Characterization)-1) as Characterization, DocTitle, rank from scope('shallow traversal of " + "\"" + "/Software" + "\"" + "," + "\"" + "/Industries" + "\"" + "," + "\"" + "/" + "\"" + "') where FREETEXT(contents,'" + searchText + "') and FileName NOT LIKE 'inc_%' and FileName NOT LIKE '%.js' and FileName NOT LIKE 'searchresult.aspx' and FileName NOT LIKE '%.css' order by rank desc "; Im getting Error: Incorrect syntax near '('. Expected ',', '.', FROM. SQLSTATE=42000
-
Can we use the SUBSTRING in Index Search select Query... ie Something like the below.. cmdSearch.CommandText = "select Vpath, path, FileName, size, write, attrib, SUBSTRING(Characterization,90,DATALENGTH(Characterization)-1) as Characterization, DocTitle, rank from scope('shallow traversal of " + "\"" + "/Software" + "\"" + "," + "\"" + "/Industries" + "\"" + "," + "\"" + "/" + "\"" + "') where FREETEXT(contents,'" + searchText + "') and FileName NOT LIKE 'inc_%' and FileName NOT LIKE '%.js' and FileName NOT LIKE 'searchresult.aspx' and FileName NOT LIKE '%.css' order by rank desc "; Im getting Error: Incorrect syntax near '('. Expected ',', '.', FROM. SQLSTATE=42000
-
Can we use the SUBSTRING in Index Search select Query... ie Something like the below.. cmdSearch.CommandText = "select Vpath, path, FileName, size, write, attrib, SUBSTRING(Characterization,90,DATALENGTH(Characterization)-1) as Characterization, DocTitle, rank from scope('shallow traversal of " + "\"" + "/Software" + "\"" + "," + "\"" + "/Industries" + "\"" + "," + "\"" + "/" + "\"" + "') where FREETEXT(contents,'" + searchText + "') and FileName NOT LIKE 'inc_%' and FileName NOT LIKE '%.js' and FileName NOT LIKE 'searchresult.aspx' and FileName NOT LIKE '%.css' order by rank desc "; Im getting Error: Incorrect syntax near '('. Expected ',', '.', FROM. SQLSTATE=42000
Hi I think there is no error in the SubString function, there is an error after scope function. For searching multiple folders, syntax is given below:
SELECT "DAV:displayname" FROM SCOPE('shallow traversal of "http://myserver/public"', 'shallow traversal of "http://myserver/public/userinfo"', 'shallow traversal of "http://myserver/public/userinfo/phonenumber"')
Please check this site for more information: http://msdn2.microsoft.com/en-us/library/aa579385(EXCHG.80).aspx[^] When i debug your code, i got the following statement:select Vpath, path, FileName, size, write, attrib, SUBSTRING(Characterization,90,DATALENGTH(Characterization)-1) as Characterization, DocTitle, rank from scope('shallow traversal of \"/Software\",\"/Industries\",\"/\"') where FREETEXT(contents,'abc') and FileName NOT LIKE 'inc_%' and FileName NOT LIKE '%.js' and FileName NOT LIKE 'searchresult.aspx' and FileName NOT LIKE '%.css' order by rank desc
which is different from the given syntax. Hope this helps.Harini
-
Have you tried removing the substring part and seeing what happens?? Anyways... whats this stuff for??
from scope('shallow traversal of " + "\"" + "/Software" + "\"" + "," + "\"" + "/Industries" + "\"" + "," + "\"" + "/" + "\"" + "')
Alexei Rodriguez
Click this link: http://msdn2.microsoft.com/en-us/library/aa579385(EXCHG.80).aspx[^]
Harini
-
Have you tried removing the substring part and seeing what happens?? Anyways... whats this stuff for??
from scope('shallow traversal of " + "\"" + "/Software" + "\"" + "," + "\"" + "/Industries" + "\"" + "," + "\"" + "/" + "\"" + "')
Alexei Rodriguez
-
Hi I think there is no error in the SubString function, there is an error after scope function. For searching multiple folders, syntax is given below:
SELECT "DAV:displayname" FROM SCOPE('shallow traversal of "http://myserver/public"', 'shallow traversal of "http://myserver/public/userinfo"', 'shallow traversal of "http://myserver/public/userinfo/phonenumber"')
Please check this site for more information: http://msdn2.microsoft.com/en-us/library/aa579385(EXCHG.80).aspx[^] When i debug your code, i got the following statement:select Vpath, path, FileName, size, write, attrib, SUBSTRING(Characterization,90,DATALENGTH(Characterization)-1) as Characterization, DocTitle, rank from scope('shallow traversal of \"/Software\",\"/Industries\",\"/\"') where FREETEXT(contents,'abc') and FileName NOT LIKE 'inc_%' and FileName NOT LIKE '%.js' and FileName NOT LIKE 'searchresult.aspx' and FileName NOT LIKE '%.css' order by rank desc
which is different from the given syntax. Hope this helps.Harini