I'm developing a client application that uses SP search web service to search in the discussion boards. I have created a scope using the contentclass STS_List_DiscussionBoard. Could you please help me to find a correct query to get the results including the single topic link and replies?

[UPDATE] I'm using the following Query packet to search in the discussion boards:

<?xml version="1.0" encoding="utf-8" ?>
<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, Size, Description, Write, Path, DiscussionLink, DiscussionTitle FROM scope() WHERE CONTAINS ('"Discover how to expand your reach"') AND  ( ("SCOPE" = 'DiscussionBoardItems') )   ORDER BY "Rank" DESC ]]></QueryText>
</Context>
<Range><StartAt>1</StartAt><Count>20</Count></Range>
</Query></QueryPacket>

I have changed the content class to STS_ListItem_DiscussionBoard, in this way I'm able to find the discussion itself and NOT the discussion list (as it was before). Now what I need is to get the number of replies of each single discussion item the web service returns. I cannot found a valid field to map in a managed property.

link|improve this question
feedback

1 Answer

Cory Roth gives some examples here on his blog. He shows a query packet that looks like this that should be passed into the web service call:

<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">SELECT Title, Path, Description, Write, Rank, Size FROM Scope() WHERE CONTAINS('Accounting') AND "Scope" = 'Corporate Documents'</QueryText>

    </Context>

  </Query>

</QueryPacket>

I have not tried this so I can't say if it'l work. But hopefully it will get you started in the right direction.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.