1

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.

2 Answers 2

0

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.

0

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.

Your Answer

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

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