Return all objects of type (assumes < MAX_HITS)
343758
def get_objects(self, search_field, search_val):
        """"""
        query = ("{ size: " + str(self.max_hits) + ", " +
                 "query: { filtered: { filter: { " +
                 search_field + ": { value: \"" + search_val + "\"" +
                 " } } } } } }")
        self.connect_es()
        res = self.es.search(index=self.index, body=query)
        # self.pr_dbg("%d Hits:" % res['hits']['total'])
        objects = {}
        for doc in res['hits']['hits']:
            objects[doc['_id']] = {}
            # To make uploading easier in the future:
            # Record all those bits into the backup.
            # Mimics how ES returns the result.
            # Prevents having to store this in some external, contrived, format
            objects[doc['_id']]['_index'] = self.index  # also in doc['_index']
            objects[doc['_id']]['_type'] = doc['_type']
            objects[doc['_id']]['_id'] = doc['_id']
            objects[doc['_id']]['_source'] = doc['_source']  # the actual result
        return objects
1121803
function getAllResults() {
    var send_object = {
        "results":  {},
        "numMatches": 0,
        "foundMaximum":  foundMaximum,
        "exceedsMaximum":  exceedsMaximum
    };
    if (!savedSearchObject) {
        return send_object;
    }
    savedSearchObject.startFileIndex = 0;
    savedSearchObject.getAllResults = true;
    return doSearch(savedSearchObject);
}
253262
def get_objects_by_type_in_subtree(self, *types):
        

        typed_objects = self.get_objects_by_type(*types)
        for child in self.objects.values():
            typed_objects += child.get_objects_by_type_in_subtree(*types)
        return typed_objects
360316
def query_all(self):
        
        if DJANGO_20_PLUS:
            obj = self._clone()
        else:
            obj = self._clone(klass=SalesforceQuerySet)  # pylint: disable=unexpected-keyword-arg
        obj.query.set_query_all()
        return obj
81820
def best_hits(self):
        
        self.quality_sort()

        best_hits = dict((query, next(blines)) for (query, blines) in \
                        groupby(self, lambda x: x.query))

        self.ref_sort()

        return best_hits
226131
def get_object_or_child_by_type(self, *types):
        

        objects = self.get_objects_or_children_by_type(*types)
        return objects[0] if any(objects) else None
1053623
def _fetch_all(cls, api_key, endpoint=None, offset=0, limit=25, **kwargs):
        
        output = []
        qp = kwargs.copy()
        limit = max(1, min(100, limit))
        maximum = kwargs.get('maximum')
        qp['limit'] = min(limit, maximum) if maximum is not None else limit
        qp['offset'] = offset
        more, total = None, None

        while True:
            entities, options = cls._fetch_page(
                api_key=api_key, endpoint=endpoint, **qp
            )
            output += entities
            more = options.get('more')
            limit = options.get('limit')
            offset = options.get('offset')
            total = options.get('total')

            if more is None:
                if total is None or offset is None:
                    break
                more = (limit + offset) < total

            if not more or (maximum is not None and len(output) >= maximum):
                break

            qp['limit'] = limit
            qp['offset'] = offset + limit

        return output
1141088
def itemtypes(cls, mapped_types, coll_type, visitor):
        
        rv = list(v for k, v in mapped_types)
        return rv[0] if len(rv) == 1 else rv
572196
def find_all(self, collection):
        
        obj = getattr(self.db, collection)
        result = obj.find()
        return result
1032107
def _parse_hits(self, hits, resource):
        """"""
        datasource = self.get_datasource(resource)
        schema = {}
        schema.update(config.DOMAIN[datasource[0]].get('schema', {}))
        schema.update(config.DOMAIN[resource].get('schema', {}))
        dates = get_dates(schema)
        docs = []
        for hit in hits.get('hits', {}).get('hits', []):
            docs.append(format_doc(hit, schema, dates))
        return ElasticCursor(hits, docs)
866079
def get_all(kind='2'):
        '''
        
        '''
        return TabPost.select().where(
            (TabPost.kind == kind) &
            (TabPost.valid == 1)
        ).order_by(
            TabPost.time_update.desc()
        )
982165
def find_all(self, **names):
        
        values = names.items()
        if len(values) != 1:
            raise ValueError('Only one query is allowed at a time')
        name, value = values[0]
        for item in self:
            if item.get(name) == value:
                yield item
648281
def fetch_all_objects_from_db(self,
                                  cls: Type[T],
                                  table: str,
                                  fieldlist: Sequence[str],
                                  construct_with_pk: bool,
                                  *args) -> List[T]:
        """"""
        return self.fetch_all_objects_from_db_where(
            cls, table, fieldlist, construct_with_pk, None, *args)
1189317
public Collection getAllObjects(Class target)
    {
        PersistenceBroker broker = getBroker();
        Collection result;
        try
        {
            Query q = new QueryByCriteria(target);
            result = broker.getCollectionByQuery(q);
        }
        finally
        {
            if (broker != null) broker.close();
        }
        return result;
    }
607610
def get_all(self, sort_order=None, sort_target='key'):
        
        return self.get(
            key=_encode(b'\0'),
            metadata=True,
            sort_order=sort_order,
            sort_target=sort_target,
            range_end=_encode(b'\0'),
        )
1250348
def filter(objects, Type=None, min=-1, max=-1): #PYCHOK muppy filter
    
    res = []
    if min > max:
        raise ValueError("minimum must be smaller than maximum")
    if Type is not None:
        res = [o for o in objects if isinstance(o, Type)]
    if min > -1:
        res = [o for o in res if _getsizeof(o) < min]
    if max > -1:
        res = [o for o in res if _getsizeof(o) > max]
    return res
773972
def items(self, obj):
        
        return TaggedItem.objects.get_by_model(
            Entry.published.all(), obj)[:self.limit]