1

I have created a managed property TaskDueDate linked to ows_DueDate(Date and Time) which I would like to display in my search query results. However the query doesn't return any values for taskDueDate.

Any ideas how I can display my custom managed property? (It looks like the KeywordQuery has the SelectProperties.Add method to achieve this)

string currentUser = SPContext.Current.Web.CurrentUser.Name;
string searchQuery = "select title, path, priority, assignedto, TaskDueDate" +
              " from scope()" + "WHERE \"scope\"=\'All Tasks\'" + 
" and assignedto = '" + currentUser + "'";

FullTextSqlQuery query = new FullTextSqlQuery(SPContext.Current.Site);
query.ResultTypes = ResultType.RelevantResults;
query.QueryText = searchQuery;
ResultTableCollection results = query.Execute();

1 Answer 1

3

You didn't mention it in your question so just to make sure...

Did you perform a Full Crawl of the content source AFTER you mapped the ows_DueDate crawled property to the TaskDueDate managed property?

Do you know for sure there is content with a value for the ows_DueDate crawled property?

SOLUTION:

The problem was due to teh fact that the FullTextQueriable parameter is by default set to false when you create custom search properties. After setting this parameter to 1 with PowerShell my FullTextSqlQuery returned the values for my custom search properties.

Set-SPEnterpriseSearchMetadataManagedproperty -Identity {you id of your custom property} -Searchapplication "Search Service Application" {In my case} -FullTextQueriable 1

4
  • - Full Crawl was done ok -There is content - Found out there is an attribute (fulltextqueriable) for managed properties which is set to null by default: msdn.microsoft.com/en-us/library/…
    – Wim Hill
    Aug 11, 2011 at 5:40
  • @Wim Hill: If that resolved your problem, please add it as the accepted solution.
    – Stu Pegg
    Aug 11, 2011 at 7:10
  • 1
    SOLUTION: The problem was due to teh fact that the FullTextQueriable parameter is by default set to false when you create custom search properties. After setting this parameter to 1 with PowerShell my FullTextSqlQuery returned the values for my custom search properties. Set-SPEnterpriseSearchMetadataManagedproperty -Identity {you id of your custom property} -Searchapplication "Search Service Application" {In my case} -FullTextQueriable 1
    – Wim Hill
    Aug 12, 2011 at 9:00
  • Can you give me the exact code, I tried this, but am getting errors. Also how do I get the id of my managed metadata property?
    – omega
    Jun 30, 2013 at 21:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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