def perform_search(<EOL>search_term,<EOL>user=None,<EOL>size=<NUM_LIT:10>,<EOL>from_=<NUM_LIT:0>,<EOL>course_id=None):
<EOL>(field_dictionary, filter_dictionary, exclude_dictionary) = SearchFilterGenerator.generate_field_filters(<EOL>user=user,<EOL>course_id=course_id<EOL>)<EOL>searcher = SearchEngine.get_search_engine(getattr(settings, "<STR_LIT>", "<STR_LIT>"))<EOL>if not searcher:<EOL><INDENT>raise NoSearchEngineError("<STR_LIT>")<EOL><DEDENT>results = searcher.search_string(<EOL>search_term,<EOL>field_dictionary=field_dictionary,<EOL>filter_dictionary=filter_dictionary,<EOL>exclude_dictionary=exclude_dictionary,<EOL>size=size,<EOL>from_=from_,<EOL>doc_type="<STR_LIT>",<EOL>)<EOL>for result in results["<STR_LIT>"]:<EOL><INDENT>result["<STR_LIT:data>"] = SearchResultProcessor.process_result(result["<STR_LIT:data>"], search_term, user)<EOL><DEDENT>results["<STR_LIT>"] = len([r for r in results["<STR_LIT>"] if r["<STR_LIT:data>"] is None])<EOL>results["<STR_LIT>"] = [r for r in results["<STR_LIT>"] if r["<STR_LIT:data>"] is not None]<EOL>return results<EOL>
Call the search engine with the appropriate parameters