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 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.

share|improve this question

migrated from stackoverflow.com Dec 18 '11 at 13:34

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
Thanks Svenson. –  Fırat Çelik Dec 6 '11 at 8:13
    
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

 
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.