class_docstr: Add indexing features to `datasets.Dataset`
class_docstr_tok: ["Add","indexing","features","to","`","datasets.Dataset","`"]
docstr: Find the nearest examples indices in the dataset to the query.
  
  Args:
      index_name (`str`):
          The `index_name`/identifier of the index.
      queries (`Union[List[str], np.ndarray]`):
          The queries as a list of strings if `index_name` is a text index or as a numpy array if `index_name` is a vector index.
      k (`int`):
          The number of examples to retrieve per query.
  
  Returns:
      `(total_scores, total_indices)`:
          A tuple of `(total_scores, total_indices)` where:
          - **total_scores** (`List[List[float]`): the retrieval scores from either FAISS (`IndexFlatL2` by default) or ElasticSearch of the retrieved examples per query
          - **total_indices** (`List[List[int]]`): the indices of the retrieved examples per query
docstr_tok: ["Find","the","nearest","examples","indices","in","the","dataset","to","the","query",".","Args",":","index_name","(","`","str","`",")",":","The","`","index_name","`","\/identifier","of","the","index",".","queries","(","`","Union","[","List","[","str","]",",","np.ndarray","]","`",")",":","The","queries","as","a","list","of","strings","if","`","index_name","`","is","a","text","index","or","as","a","numpy","array","if","`","index_name","`","is","a","vector","index",".","k","(","`","int","`",")",":","The","number","of","examples","to","retrieve","per","query",".","Returns",":","`","(","total_scores",",","total_indices",")","`",":","A","tuple","of","`","(","total_scores",",","total_indices",")","`","where",":","-","*","*","total_scores","*","*","(","`","List","[","List","[","float","]","`",")",":","the","retrieval","scores","from","either","FAISS","(","`","IndexFlatL2","`","by","default",")","or","ElasticSearch","of","the","retrieved","examples","per","query","-","*","*","total_indices","*","*","(","`","List","[","List","[","int","]","]","`",")",":","the","indices","of","the","retrieved","examples","per","query"]
code: def search_batch(
      self,
      index_name: str,
      queries: Union[List[str], np.array],
      k: int = 10,
      **kwargs,
  ) -> BatchedSearchResults:
      """Find the nearest examples indices in the dataset to the query.
  
      Args:
          index_name (`str`):
              The `index_name`/identifier of the index.
          queries (`Union[List[str], np.ndarray]`):
              The queries as a list of strings if `index_name` is a text index or as a numpy array if `index_name` is a vector index.
          k (`int`):
              The number of examples to retrieve per query.
  
      Returns:
          `(total_scores, total_indices)`:
              A tuple of `(total_scores, total_indices)` where:
              - **total_scores** (`List[List[float]`): the retrieval scores from either FAISS (`IndexFlatL2` by default) or ElasticSearch of the retrieved examples per query
              - **total_indices** (`List[List[int]]`): the indices of the retrieved examples per query
      """
      self._check_index_is_initialized(index_name)
      return self._indexes[index_name].search_batch(
          queries, k, **kwargs
      )
  
imports: import importlib.util
  import os
  import tempfile
  from pathlib import PurePath
  from typing import TYPE_CHECKING, Dict, List, NamedTuple, Optional, Union
  import fsspec
  import numpy
  from .utils import logging
  from .utils import tqdm
label_desc: Use image node_id 16 for calling the IndexableMixin obj's underlying member method code with example usage: obj.search_batch(index_name, queries, k) and returns: self