class_docstr: Generic service for search records operations
class_docstr_tok: ["Generic","service","for","search","records","operations"]
docstr: Scan records for a queried
docstr_tok: ["Scan","records","for","a","queried"]
code: def scan_records(
      self,
      dataset: ServiceDataset,
      record_type: Optional[Type[ServiceRecord]] = None,
      query: Optional[ServiceRecordsQuery] = None,
      projection: Set[str] = None,
      id_from: Optional[str] = None,
      limit: int = 1000,
  ) -> Iterable[ServiceRecord]:
      """Scan records for a queried"""
      search = DaoRecordsSearch(query=query)
  
      transform_doc = lambda doc: doc
      if record_type:
          transform_doc = record_type.parse_obj
  
      for doc in self.__dao__.scan_dataset(
          dataset,
          id_from=id_from,
          limit=limit,
          search=search,
          include_fields=projection,
      ):
          yield transform_doc(doc)
  
file_path: argilla/src/argilla/server/services/search/service.py
imports: import logging
  from typing import Iterable, List, Optional, Set, Type, Union
  from fastapi import Depends
  from argilla.server.daos.models.records import DaoRecordsSearch
  from argilla.server.daos.records import DatasetRecordsDAO
  from argilla.server.errors import RecordNotFound
  from argilla.server.services.datasets import ServiceDataset
  from argilla.server.services.metrics import MetricsService
  from argilla.server.services.metrics.models import ServiceMetric
  from argilla.server.services.search.model import ServiceRecord, ServiceRecordsQuery, ServiceSearchResults, ServiceSortConfig
label_desc: Use image node_id 4 for calling the SearchRecordsService obj's underlying member method code with example usage: obj.scan_records(dataset, record_type, query, projection, id_from, limit) without return types