Exemplo n.º 1
0
def _search_by_keyword(query, entity_name, per_page, page_num):
    # correct entries that contans query at EntryName or AttributeValue
    search_result = Entry.search_entries_for_simple(query, entity_name,
                                                    per_page,
                                                    (page_num - 1) * per_page)

    return (search_result['ret_count'], search_result['ret_values'])
Exemplo n.º 2
0
    def get_queryset(self):
        queryset = []
        query = self.request.query_params.get("query", None)

        if not query:
            return queryset

        results = Entry.search_entries_for_simple(
            query, limit=ENTRY_CONFIG.MAX_SEARCH_ENTRIES)
        return results["ret_values"]