Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

Problem in executequery for fulltextquery

$
0
0

Hello

I am using following code for search result, i

FullTextSqlQuery oSearchQuery = new FullTextSqlQuery(SPContext.Current.Site);
            oSearchQuery.ResultTypes = ResultType.RelevantResults;
            oSearchQuery.RowLimit = 0;
            oSearchQuery.EnablePhonetic = true;
            oSearchQuery.TrimDuplicates = false;
            oSearchQuery.EnableStemming = true;
            //string SQL = @"select ID,Title from scope() where FREETEXT(DEFAULTPROPERTIES, '*123*')";
            string SQL = @"SELECT Title FROM SCOPE() WHERE scope = 'All Sites' AND CONTAINS(Title, '123')";
            oSearchQuery.QueryText = SQL;
            oSearchQuery.ResultTypes = ResultType.RelevantResults;
            ResultTableCollection searchResults = oSearchQuery.Execute(); 

I am getting errror in following line

ResultTableCollection searchResults = oSearchQuery.Execute();

Please let me know whats wrong I am doing in above code?

Avian



Viewing all articles
Browse latest Browse all 11508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>