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

I want to get all items of a custom content type while using fast search. I want to use keyword search but i also could use fql. Can somebody show me how to do this in code? I'm getting restults for standard content types when using something like Querytest = "contenttype:document".

[Update] The problem was that i only started a crawl on the content source for the Fast Search Query Server not for the connector.

Thanks for the answers.

share|improve this question
up vote 0 down vote accepted

I'm not 100% on setting up FAST, but in Enterprise Search, you have to modify the crawled property ows_contenttype to include the values in the search index, and the managed property ContentType should return the values, and allow you to search by it.

share|improve this answer

Try the following:

KeywordQuery keywordQuery = new KeywordQuery(SPContext.Current.Site);

keywordQuery.QueryText = "ContentType:Document";
keywordQuery.ResultsProvider = SearchProvider.Default;
keywordQuery.ResultTypes = ResultType.RelevantResults;
ResultTableCollection results = keywordQuery.Execute();
ResultTable resultsTable = results[ResultType.RelevantResults];
DataTable dataTable = new DataTable();
dataTable.TableName = "Results";
dataTable.Load(resultsTable, LoadOption.OverwriteChanges);

You can then access the results from within the DataTable returned.

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.