Q:

Sharepoint search query fields missing in my 2010 sharepoint version

The below query i used to search the content of the MOSS 2007 site and SP 2010 site.
I get the ContentType value in MOSS site.But if i use the same query with ContentType, It will give the malformed error.
SELECT Title, Rank, Size, Description, Write, Path, contentclass,FROM Scope()
WHERE FREETEXT(DefaultProperties, '1') ORDER BY "Rank" DESC
What the exactly the problem?. IS I need to add the ContentType column name in search service application(metadata propertie). or it need to do any configuration.
Also i am using sharepoint search tool there itself for 2010 it's not showing the ContentType Column.

A:

Try using following query
SELECT Title, Rank, Size, Description, Write, Path, contentclass,FROM portal..scope() WHERE FREETEXT(DefaultProperties, '1') ORDER BY "Rank" DESC
I had faced same issue while I consumed Search.asmx and searching for MOSS 2007 site and SP2010. I was getting proper data for MOSS 2007 using only scope() but for SP 2010 I need to put portal..scope().
Also have a look at here

