I have a custom content type which contain duplicate values. I try to remove duplicate results from Query Web service returns. For specify duplicate data, I created "groupid" managed property which is type of integer. This managed property hold same value for duplicate record.

I added TrimDuplicates Element to Query like below.

<TrimDuplicates onproperty="groupid" keepcount="1">true</TrimDuplicates>

After adding TrimDuplicates Element, I send query to web service. Query Service returns all duplicate records, although the same "groupid".

How can I remove duplicate results to use custom managed property(using onproperty attr)?

Thanks for your attention.


You have to make sure the column which holds the duplicate value is of type integer. Columns or site columns created via SharePoint UI is of type Decimal. You can perfectly well map a decimal type crawled property to an integer type managed property, but it just won't work. And there is no error given.

So either create an integer site column which you add to a content type via code, or create a custom pipeline extensibility stage which outputs the duplicate value to a crawled property of type integer, which you then map to your managed property.

The managed property you filter on should be set to both queryable and sortable.

If you execute a query and add

<Property name="groupid" />

You can check if that property is returning values for your items.

  • Svenson, thank you very much. I solved problem with your help.I already set managed property to queryable but not adding sortable property.I added sortable setting to managed property. Now, it is working correctly – Fırat Çelik Dec 6 '11 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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