class_docstr: Sparse index using Elasticsearch. It is used to index text and run queries based on BM25 similarity.
  An Elasticsearch server needs to be accessible, and a python client is declared with
  ```
  es_client = Elasticsearch([{'host': 'localhost', 'port': '9200'}])
  ```
  for example.
class_docstr_tok: ["Sparse","index","using","Elasticsearch",".","It","is","used","to","index","text","and","run","queries","based","on","BM25","similarity",".","An","Elasticsearch","server","needs","to","be","accessible",",","and","a","python","client","is","declared","with","``","`","es_client","=","Elasticsearch","(","[","{","'host","'",":","'localhost","'",",","'port","'",":","'9200","'","}","]",")","``","`","for","example","."]
code: def search_batch(
      self, queries, k: int = 10, max_workers=10, **kwargs
  ) -> BatchedSearchResults:
      import concurrent.futures
  
      total_scores, total_indices = [None] * len(queries), [None] * len(
          queries
      )
      with concurrent.futures.ThreadPoolExecutor(
          max_workers=max_workers
      ) as executor:
          future_to_index = {
              executor.submit(self.search, query, k, **kwargs): i
              for i, query in enumerate(queries)
          }
          for future in concurrent.futures.as_completed(
              future_to_index
          ):
              index = future_to_index[future]
              results: SearchResults = future.result()
              total_scores[index] = results.scores
              total_indices[index] = results.indices
      return BatchedSearchResults(
          total_indices=total_indices, total_scores=total_scores
      )
  
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 4 for calling the ElasticSearchIndex obj's underlying member method code with example usage: obj.search_batch(queries, k, max_workers) and returns: BatchedSearchResults