@utilities.arguments_not_none<EOL><INDENT>def get_items_by_search(self, item_query, item_search):<DEDENT>
<EOL>and_list = list()<EOL>or_list = list()<EOL>for term in item_query._query_terms:<EOL><INDENT>and_list.append({term: item_query._query_terms[term]})<EOL><DEDENT>for term in item_query._keyword_terms:<EOL><INDENT>or_list.append({term: item_query._keyword_terms[term]})<EOL><DEDENT>if item_search._id_list is not None:<EOL><INDENT>identifiers = [ObjectId(i.identifier) for i in item_search._id_list]<EOL>and_list.append({'<STR_LIT>': {'<STR_LIT>': identifiers}})<EOL><DEDENT>if or_list:<EOL><INDENT>and_list.append({'<STR_LIT>': or_list})<EOL><DEDENT>view_filter = self._view_filter()<EOL>if view_filter:<EOL><INDENT>and_list.append(view_filter)<EOL><DEDENT>if and_list:<EOL><INDENT>query_terms = {'<STR_LIT>': and_list}<EOL><DEDENT>collection = JSONClientValidated('<STR_LIT>',<EOL>collection='<STR_LIT>',<EOL>runtime=self._runtime)<EOL>if item_search.start is not None and item_search.end is not None:<EOL><INDENT>result = collection.find(query_terms)[item_search.start:item_search.end]<EOL><DEDENT>else:<EOL><INDENT>result = collection.find(query_terms)<EOL><DEDENT>return searches.ItemSearchResults(result, dict(item_query._query_terms), runtime=self._runtime)<EOL>
Gets the search results matching the given search query using the given search.

        arg:    item_query (osid.assessment.ItemQuery): the item query
        arg:    item_search (osid.assessment.ItemSearch): the item
                search
        return: (osid.assessment.ItemSearchResults) - the returned
                search results
        raise:  NullArgument - ``item_query`` or ``item_search`` is
                ``null``
        raise:  OperationFailed - unable to complete request
        raise:  PermissionDenied - authorization failure occurred
        raise:  Unsupported - ``item_search`` or ``item_query`` is not
                of this service
        *compliance: mandatory -- This method must be implemented.*