Beispiel #1
0
 def normal_find_ids(self, limit_ids=None):
     _query = self.query_builder.build()
     q = Query(_query).no_content().paging(0, 1000000)
     if limit_ids is not None and len(limit_ids) > 0:
         q.limit_ids(*limit_ids)
     results = self.client.search(q)
     result_docs = results.docs
     return [res.id for res in result_docs]
Beispiel #2
0
    def normal_find(self, limit_ids=None):
        built = self.query_builder.build()
        q = Query(built).paging(0, 1000000)
        if limit_ids is not None and len(limit_ids) > 0:
            q.limit_ids(*limit_ids)

        results = self.client.search(q)
        result_docs = results.docs
        return result_docs
Beispiel #3
0
    def get_query(self, query_string, limit_range, filters):
        INF = '+inf'
        NEG_INF = '-inf'

        q = Query(query_string)

        for index in self.numeric_indexes:
            lower, upper = NEG_INF, INF
            if filters.get(index) is not None:
                lower, upper = filters[index].split(',')
            q.add_filter(NumericFilter(index, lower, upper))

        # default paging is performed for only 10 entries
        # We allow returning all entries (4000) and
        # paging is performed through the limit ids.
        q.limit_ids(*limit_range).paging(0, 4000)

        return q