Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to get all content authors for the search query results. I'm using following query:

<QueryPacket xmlns="urn:Microsoft.Search.Query">
  <Query>
      <SupportedFormats>
        <Format>urn:Microsoft.Search.Response.Document.Document</Format>
      </SupportedFormats>
    <Context>
       <QueryText type="FQL">forsiden</QueryText>
    </Context>
    <Properties>
      <Property name="Author" />
    </Properties>
    <TrimDuplicates onproperty="Author">true</TrimDuplicates>
  </Query>
 </QueryPacket>

But search results still contain duplicate values for Author property. Query is valid according to schema and TrimDuplicates part. What am I doing wrong?

EDIT

According to Mikael Svenson I'm trying to use such query:

<QueryPacket xmlns="urn:Microsoft.Search.Query">
  <Query>
    <SupportedFormats>
      <Format>urn:Microsoft.Search.Response.Document.Document</Format>
    </SupportedFormats>
    <Context>
      <QueryText type="FQL">us</QueryText>
    </Context>
    <Properties>
      <Property name="Author" />
    </Properties>
    <EnableStemming>true</EnableStemming>
    <EnableSpellCheck>false</EnableSpellCheck>
    <IncludeRelevantResults>false</IncludeRelevantResults>
    <Range>
      <Count>20</Count>
    </Range>
    <IncludeRefinementResults>
      <Refiners>
        <Refiner>author</Refiner>
      </Refiners>
    </IncludeRefinementResults>
  </Query>
</QueryPacket>

But resulting data set has no tables at all. I cant set ResultProvider to FASTSearch because when I do so, it throws exception:

The search request was unable to connect to the Search Service.

Maybe refiners cant be used with search server? But in features it is listed.

share|improve this question
add comment

2 Answers

According to the schema documentation:

Query.TrimDuplicates.onproperty: Specifies the name of a managed property to use for duplicate result removal. The managed property MUST be of type integer.

share|improve this answer
    
So its not possible to get distinct authors? –  Sly May 19 '11 at 6:27
add comment

It's quite easy. You have to think a bit different about the problem. In a user interface refiners give you distinct values with count, so get the refiners for Authors instead. No need for trimming.

The following query was created using the query tool at http://fastforsharepoint.codeplex.com/.

<QueryPacket Revision="1000">
  <Query>
    <Context>
      <QueryText language="en-US" type="FQL">forsiden</QueryText>
    </Context>
    <SupportedFormats Format="urn:Microsoft.Search.Response.Document.Document" />
    <ResultProvider>FASTSearch</ResultProvider>
    <Range>
      <StartAt>1</StartAt>
      <Count>0</Count>
    </Range>
    <EnableStemming>true</EnableStemming>
    <EnableSpellCheck>Off</EnableSpellCheck>
    <IncludeSpecialTermsResults>false</IncludeSpecialTermsResults>
    <IncludeRelevantResults>false</IncludeRelevantResults>
    <ImplicitAndBehavior>true</ImplicitAndBehavior>
    <IncludeRefinementResults>
      <Refiners>
        <Refiner>author</Refiner>
      </Refiners>
    </IncludeRefinementResults>
  </Query>
</QueryPacket>
share|improve this answer
    
For the search server 2010 RefinementResults table is not present in resulting dataset. Does Refiners can be applied to it? –  Sly May 19 '11 at 7:51
1  
I assumed you were using FAST for SharePoint as you tagged your question with "fast". So, it's search server you are using? Then you have to modify the query, as "FQL" is not supported by search server. –  Mikael - SharePoint MVP May 20 '11 at 8:50
    
Yes, I'm using search server. Which language is supported by it? only STRING? And still the same question, does it supports refiners? –  Sly May 20 '11 at 10:46
    
I suggest you download the tool and try it out. It works for SharePoint stand-alone as well, so most likely also search server. I don't have search server at hand, but give it a try and let me know how it goes. And refiners should be supported. –  Mikael - SharePoint MVP May 20 '11 at 19:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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