code: def _query(self, query: str, top_n: int, thresh: float):
      # build the query dataframe
      if not hasattr(self, "search_index"):
          self.build_index()
  
      qdf = pd.DataFrame([])
  
      cols_text = self._node_encoder.text_cols  # type: ignore
  
      if len(cols_text) == 0:
          logger.warn(
              "** Querying is only possible using Transformer/Ngrams embeddings"
          )
          return pd.DataFrame([]), None
  
      qdf[cols_text[0]] = [query]
      if len(cols_text) > 1:
          for col in cols_text[1:]:
              qdf[col] = [""]
  
      # this is hookey and needs to be fixed on dirty_cat side (with errors='ignore')
      # if however min_words = 0, all columns will be textual,
      # and no other data_encoder will be generated
      if hasattr(self._node_encoder.data_encoder, "columns_"):  # type: ignore
          other_cols = self._node_encoder.data_encoder.columns_  # type: ignore
  
          if other_cols is not None and len(other_cols):
              logger.warn(
                  "** There is no easy way to encode categorical or other features at query time. "
                  f"Set `thresh` to a large value if no results show up.\ncolumns: {other_cols}"
              )
              df = self._nodes
              dt = df[other_cols].dtypes
              for col, v in zip(other_cols, dt.values):
                  if str(v) in ["string", "object", "category"]:
                      qdf[col] = df.sample(1)[col].values  # so hookey
                  elif str(v) in [
                      "int",
                      "float",
                      "float64",
                      "float32",
                      "float16",
                      "int64",
                      "int32",
                      "int16",
                      "uint64",
                      "uint32",
                      "uint16",
                  ]:
                      qdf[col] = df[col].mean()
  
      return self._query_from_dataframe(qdf, thresh=thresh, top_n=top_n)
  
file_path: pygraphistry/graphistry/text_utils.py
imports: import pandas
  from .feature_utils import FeatureMixin
  from .ai_utils import search_to_df, FaissVectorSearch
  from .constants import WEIGHT, DISTANCE
  from logging import getLogger
  from typing import TYPE_CHECKING
label_desc: Use image node_id 6 for calling the SearchToGraphMixin obj's underlying member method code with example usage: obj._query(query, top_n, thresh) and returns: self, pd,  None