class_docstr: Class for building and working with Online Hierarchical Navigable Small World index.
class_docstr_tok: ["Class","for","building","and","working","with","Online","Hierarchical","Navigable","Small","World","index","."]
docstr: Get approximate nearest neighbors for query from index and add item to index
  
  Parameters
  ----------
  query : list or numpy.ndarray
      Vector for which nearest neighbors should be found.
      Vector which should be added in index.
  
  Returns
  -------
  neighbors : list of tuples (id, distance) with length = search_neighborhood_size
docstr_tok: ["Get","approximate","nearest","neighbors","for","query","from","index","and","add","item","to","index","Parameters","--","--","--","--","--","query",":","list","or","numpy.ndarray","Vector","for","which","nearest","neighbors","should","be","found",".","Vector","which","should","be","added","in","index",".","Returns","--","--","--","-","neighbors",":","list","of","tuples","(","id",",","distance",")","with","length","=","search_neighborhood_size"]
code: def get_nearest_and_add_item(self, query):
      """
      Get approximate nearest neighbors for query from index and add item to index
  
      Parameters
      ----------
      query : list or numpy.ndarray
          Vector for which nearest neighbors should be found.
          Vector which should be added in index.
  
      Returns
      -------
      neighbors : list of tuples (id, distance) with length = search_neighborhood_size
      """
      return self._online_index._get_nearest_neighbors_and_add_item(
          query
      )
  
imports: import sys
  import os
  from six import iteritems
  from enum import IntEnum
  from contextlib import contextmanager
  import json
label_desc: Use image node_id 2 for calling the OnlineHnsw obj's underlying member method code with example usage: obj.get_nearest_and_add_item(query) and returns: self