.net - Sharepoint Object Model vs WebServices -
i had created xml query sending sharepoint search service returning results. pulled sql query text out of , started using object model , it's not working. doing wrong based on code below?
query xml (returns results):
<querypacket xmlns="urn:microsoft.search.query" revision="1000"> <query domain="qdomain"> <supportedformats><format>urn:microsoft.search.response.document.document</format></supportedformats> <context> <querytext language="en-us" type="mssqlft"><![cdata[ select title, rank, owspublished1,owssocialx0020networkx0020update, description, write, path scope() order "rank" desc ]]></querytext> </context> <range><startat>1</startat><count>20</count></range> <enablestemming>false</enablestemming> <trimduplicates>true</trimduplicates> <ignoreallnoisequery>true</ignoreallnoisequery> <implicitandbehavior>true</implicitandbehavior> <includerelevanceresults>true</includerelevanceresults> <includespecialtermresults>true</includespecialtermresults> <includehighconfidenceresults>true</includehighconfidenceresults> </query></querypacket> object model code (doesn't):
spsite site = new spsite("http://sp-dev/"); servercontext sc = servercontext.getcontext(site); fulltextsqlquery ftq = new fulltextsqlquery(sc); string querysql = @"select title, rank, owspublished1,owssocialx0020networkx0020update, description, write, path scope() order ""rank"" desc "; ftq.querytext = querysql;; resulttablecollection results = ftq.execute();
you need @ least add:
ftq.enablestemming = false; ftq.trimduplicates = true; ftq.ignoreallnoisequery = true; ftq.keywordinclusion = keywordinclusion.allkeywords; to @ least make fair comparison between 2 methods. then, can try:
ftq.authenticationtype = queryauthenticationtype.pluggableauthenticatedquery;
Comments
Post a Comment