Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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
add comment

2 Answers 2

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
add comment

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
add comment

Your Answer

 
discard

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.