0
votes

I had written a custom search query for MOSS 2007 to get data where contenttype is post. However the same query is not returning any results in SharePoint 2010. Any inputs will be appreciated.

Please note that SharePoint search box is returning (parameter k in query string and also contenttype:post) appropriate results.

Thanks,

2
Hi David, thanks.The query looks like this: SELECT TOP 3 title,path,author body FROM scope() WHERE (contenttype = 'post' ) AND (path like '<site url>')Faiz
All, An update to this.The query is running fine if i remove the like clause. For example: SELECT title,body,author,path from scope() where contenttype='post' works perfect. But when i add like condition: SELECT title,body,author,path from scope() where contenttype='post' and title like 'MyBlog%' does not return any results though there are many blogs starting with MyyBlogFaiz

2 Answers

1
votes

Did you get this issue resolved. I've got a similar issue

The following worked

SELECT TOP 3 title,path,author body FROM scope() WHERE (contenttype = 'post' ) AND CONTAINS(path,'siteurl')

This didn't work (even though it should work)

SELECT TOP 3 title,path,author body FROM scope() WHERE (contenttype = 'post' ) AND CONTAINS(path,'siteur*')

1
votes

try:

SELECT TOP 3 title,path,author body FROM scope() WHERE (contenttype = "post" ) AND CONTAINS(path,"siteur*")