Identical to getRecords except provided with a search query.
184737
public function searchRecords($query, $offset, $count)
    {
        return $this->fireEvent('data.searchRecords', [$query, $offset, $count], true);
    }
196563
public static function get_records($filters = array(), $sort = '', $order = 'ASC', $skip = 0, $limit = 0) {
        global $DB;

        $orderby = '';
        if (!empty($sort)) {
            $orderby = $sort . ' ' . $order;
        }

        $records = $DB->get_records(static::TABLE, $filters, $orderby, '*', $skip, $limit);
        $instances = array();

        foreach ($records as $record) {
            $newrecord = new static(0, $record);
            array_push($instances, $newrecord);
        }
        return $instances;
    }
276854
def get_records(self):
        
        self.close()
        with open(self.path, 'r') as filep:
            first_line = filep.readline().split(',')
            if first_line[0] != self.fields[0]:
                yield first_line

            for line in filep:
                yield line.split(',')
244814
def -(other)
      records = @records.clone.reject { |name, records| other.records.include?(name) }
      SearchAtom.new(records)
    end
1161378
def _filter_records(self, records, rtype=None, name=None, content=None, identifier=None):  # pylint: disable=too-many-arguments,no-self-use
        
        if not records:
            return []
        if identifier is not None:
            LOGGER.debug('Filtering %d records by id: %s', len(records), identifier)
            records = [record for record in records if record['id'] == identifier]
        if rtype is not None:
            LOGGER.debug('Filtering %d records by type: %s', len(records), rtype)
            records = [record for record in records if record['type'] == rtype]
        if name is not None:
            LOGGER.debug('Filtering %d records by name: %s', len(records), name)
            if name.endswith('.'):
                name = name[:-1]
            records = [record for record in records if name == record['name']]
        if content is not None:
            LOGGER.debug('Filtering %d records by content: %s', len(records), content.lower())
            records = [record for record in records if
                       record['content'].lower() == content.lower()]
        return records
996217
def get_records(cls, ids, with_deleted=False):
        
        with db.session.no_autoflush:
            query = RecordMetadata.query.filter(RecordMetadata.id.in_(ids))
            if not with_deleted:
                query = query.filter(RecordMetadata.json != None)  # noqa

            return [cls(obj.json, model=obj) for obj in query.all()]
62180
def refreshRecords( self ):
        
        table_type = self.tableType()
        if ( not table_type ):
            self._records = RecordSet()
            return False
        
        search = nativestring(self.uiSearchTXT.text())
        
        query = self.query().copy()
        terms, search_query = Q.fromSearch(search)
        
        if ( search_query ):
            query &= search_query
        
        self._records = table_type.select(where = query).search(terms)
        return True
573532
def get(self, schema, query=None, **kwargs):
        
        ret = self._get_query(self._get, schema, query, **kwargs)
        if not ret: ret = []
        return ret
1092012
def lookupAllRecords(self, name, timeout = None):
        
        return self._lookup(name, dns.IN, dns.A, timeout)
1217247
def get_record_sets(record):
    """"""
    # get lists of sets with search_pattern equals to None but already in the
    # set list inside the record
    record_sets = set(record.get('_oai', {}).get('sets', []))
    for spec in _build_cache():
        if spec in record_sets:
            yield spec

    # get list of sets that match using percolator
    index, doc_type = RecordIndexer().record_to_index(record)
    document = record.dumps()

    percolator_doc_type = _get_percolator_doc_type(index)
    _create_percolator_mapping(index, percolator_doc_type)
    results = _percolate_query(index, doc_type, percolator_doc_type, document)
    prefix = 'oaiset-'
    prefix_len = len(prefix)
    for match in results:
        set_name = match['_id']
        if set_name.startswith(prefix):
            name = set_name[prefix_len:]
            yield name

    raise StopIteration
699164
def retrieve_records(self, timeperiod, include_running,
                         include_processed, include_noop, include_failed, include_disabled):
        
        resp = dict()
        resp.update(self._search_by_level(COLLECTION_JOB_HOURLY, timeperiod, include_running,
                                          include_processed, include_noop, include_failed, include_disabled))
        resp.update(self._search_by_level(COLLECTION_JOB_DAILY, timeperiod, include_running,
                                          include_processed, include_noop, include_failed, include_disabled))

        timeperiod = time_helper.cast_to_time_qualifier(QUALIFIER_MONTHLY, timeperiod)
        resp.update(self._search_by_level(COLLECTION_JOB_MONTHLY, timeperiod, include_running,
                                          include_processed, include_noop, include_failed, include_disabled))

        timeperiod = time_helper.cast_to_time_qualifier(QUALIFIER_YEARLY, timeperiod)
        resp.update(self._search_by_level(COLLECTION_JOB_YEARLY, timeperiod, include_running,
                                          include_processed, include_noop, include_failed, include_disabled))
        return resp
27460
def _list_records(self, rtype=None, name=None, content=None):
        
        if name:
            name = self._relative_name(name)
        if not rtype:
            rtype = "ANY"

        filter_query = {"rdtype": rtype, "name": name, "content": content}

        with localzone.manage(self.filename, self.origin, autosave=True) as zone:
            records = zone.find_record(**filter_query)  # pylint: disable=no-member

        result = []
        for record in records:
            rdict = {
                "type": record.rdtype,
                "name": self._full_name(record.name),
                "ttl": record.ttl,
                "content": record.content,
                "id": record.hashid,
            }

            if rdict["type"] == "TXT":
                rdict["content"] = rdict["content"].replace('"', "")

            result.append(rdict)

        LOGGER.debug("list_records: %s", result)
        return result
1206102
function findRecord(options) {
    let query = getQueryParams(options, ['name', 'content', 'type', 'query']);
    return find(options.domain, query).then(function (result) {
      return new Result(result.data.result);
    });
  }
1197254
def iterateRecordInfos(dbid, query = nil, qid = nil, qname = nil, clist = nil, slist = nil, fmt = "structured", options = nil)
      getSchema(dbid)
      recordIDFieldName = lookupFieldNameFromID("3")
      fieldNames = getFieldNames
      fieldIDs = {}
      fieldNames.each{|name|fieldIDs[name] = lookupFieldIDByName(name)}
      iterateRecords(dbid, [recordIDFieldName], query, qid, qname, clist, slist, fmt, options){|r|
        getRecordInfo(dbid,r[recordIDFieldName])
        fieldValues = {}
        fieldIDs.each{|k,v| 
          fieldValues[k] = getFieldDataPrintableValue(v)
          fieldValues[k] ||= getFieldDataValue(v)
        }        
        yield fieldValues
      }
  end
113299
def query(self, constraint, sortby=None, typenames=None, maxrecords=10, startposition=0):
        

        # run the raw query and get total
        # we want to exclude layers which are not valid, as it is done in the search engine
        if 'where' in constraint:  # GetRecords with constraint
            query = self._get_repo_filter(Layer.objects).filter(
                is_valid=True).extra(where=[constraint['where']], params=constraint['values'])
        else:  # GetRecords sans constraint
            query = self._get_repo_filter(Layer.objects).filter(is_valid=True)

        total = query.count()

        # apply sorting, limit and offset
        if sortby is not None:
            if 'spatial' in sortby and sortby['spatial']:  # spatial sort
                desc = False
                if sortby['order'] == 'DESC':
                    desc = True
                query = query.all()
                return [str(total),
                        sorted(query,
                               key=lambda x: float(util.get_geometry_area(getattr(x, sortby['propertyname']))),
                               reverse=desc,
                               )[startposition:startposition+int(maxrecords)]]
            else:
                if sortby['order'] == 'DESC':
                    pname = '-%s' % sortby['propertyname']
                else:
                    pname = sortby['propertyname']
                return [str(total),
                        query.order_by(pname)[startposition:startposition+int(maxrecords)]]
        else:  # no sort
            return [str(total), query.all()[startposition:startposition+int(maxrecords)]]
1252141
def currentRecord( self ):
        
        if self._currentRecord is None and self.isRequired():
            self._currentRecord = self.recordAt(self.currentIndex())
        return self._currentRecord
1190811
def records(self):
        """"""

        return (self._session.query(Process)
                .filter(Process.d_vid == self._d_vid)).all()