SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im trying to search on the managed property numcomments. This property is the number of comments stored for a blog post. The proprty is a text field which means if im also sorting by it, 11 comes before 2.
Ive tried to create a new manage property mapping to comments but storing it as an integer. No results are showing in search when i search by this new managed property term.
Is there a way to store text data, in an integer search managed property. I think the reason why ows_comments is a text field instead of a integer might have something to do with it being a lookup column.
I really need to call a keyword search in code and sorting by numcomments correctly. Can anyone suggest anything?

share|improve this question

You have to use a pipeline extensibility stage which reads the text based property and writes it back to a new crawled property of type int, which you can map to an int based managed property.

I've done the same for date <meta> tags in web pages which are interpreted as text, but you want them as dates.

I have a powershell prototype sample here which you can use as a basis to test this:

share|improve this answer

Your Answer


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.