SharePoint 2010 Full Text SQL Query – Ranged query results through Search Web Service

If you are wondering how to do a ranged search query through the SP search service pass to the query service something below where the ranged functionality is in the green color. Just specify the start position at the StartAt, notice that the minimum start position is number one not zero. Then you pass in the Count part how many items to retrieve starting from the specified location. To do a paging like functionality you have to keep count in you code what is your paging range, current position and what to retrieve.

<QueryPacket><Query domain=”QDomain”><Context><QueryText type=”MSSQLFT”><![CDATA[ SELECT your fields here FROM Scope() WHERE IsDocument = 1 AND “SCOPE” = ‘your scope name’ AND CONTAINS (some sample field,’field data to contain’) ORDER BY some field name]]></QueryText></Context><Range><StartAt>1</StartAt><Count>3</Count></Range><TrimDuplicates>false</TrimDuplicates></Query></QueryPacket>

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s