Welcome to my personal blog, All the information in this bogs is my ideas,findings and thoughts on .Net, Asp.Net and SharePoint.
ALL POSTING ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND
The max number of characters that can be passed through FullTextSqlQuery is 4096 characters, beyond this length throws an exception ArgumentOutOfRangeException. You will get the same behavior when using the webservice QueryEx(XmlNode) as well.
1: private void ExecQuery()
2: { 3: ResultTableCollection resultCollection = null;
4: SPSite site = new SPSite("http://server/"); 5: FullTextSqlQuery fullText = new FullTextSqlQuery(site);
6: fullText.ResultTypes = ResultType.RelevantResults;
7: fullText.QueryText = "SELECT Title, Path, Description, Write, Rank, Size FROM Scope()"; //max 4096
8: fullText.KeywordInclusion =KeywordInclusion.AnyKeyword;
9: resultCollection = fullText.Execute();
10: ResultTable results = resultCollection[ResultType.RelevantResults];
11: dataGridView1.DataSource = null;
12: if (results.RowCount > 0)
13: { 14: DataTable dtresults = new DataTable();
15: dtresults.TableName = "Result"
16: dtresults.Load(results, LoadOption.OverwriteChanges);
17: DataSet ds = new DataSet("All_Results"); 18: ds.Tables.Add(dtresults);
19: dataGridView1.DataSource = ds;
20: dataGridView1.DataMember = "Result";
21: }
22: }
Hope this helps.
Anonymous comments are disabled