class_docstr: Search commands.
class_docstr_tok: ["Search","commands","."]
docstr: Add a single document to the index.
  
  ### Parameters
  
  - **doc_id**: the id of the saved document.
  - **nosave**: if set to true, we just index the document, and don't
                save a copy of it. This means that searches will just
                return ids.
  - **score**: the document ranking, between 0.0 and 1.0
  - **payload**: optional inner-index payload we can save for fast
  i              access in scoring functions
  - **replace**: if True, and the document already is in the index,
  we perform an update and reindex the document
  - **partial**: if True, the fields specified will be added to the
                 existing document.
                 This has the added benefit that any fields specified
                 with `no_index`
                 will not be reindexed again. Implies `replace`
  - **language**: Specify the language used for document tokenization.
  - **no_create**: if True, the document is only updated and reindexed
                   if it already exists.
                   If the document does not exist, an error will be
                   returned. Implies `replace`
  - **fields** kwargs dictionary of the document fields to be saved
                   and/or indexed.
               NOTE: Geo points shoule be encoded as strings of "lon,lat"
docstr_tok: ["Add","a","single","document","to","the","index",".","#","#","#","Parameters","-","*","*","doc_id","*","*",":","the","id","of","the","saved","document",".","-","*","*","nosave","*","*",":","if","set","to","true",",","we","just","index","the","document",",","and","don't","save","a","copy","of","it",".","This","means","that","searches","will","just","return","ids",".","-","*","*","score","*","*",":","the","document","ranking",",","between","0.0","and","1.0","-","*","*","payload","*","*",":","optional","inner-index","payload","we","can","save","for","fast","i","access","in","scoring","functions","-","*","*","replace","*","*",":","if","True",",","and","the","document","already","is","in","the","index",",","we","perform","an","update","and","reindex","the","document","-","*","*","partial","*","*",":","if","True",",","the","fields","specified","will","be","added","to","the","existing","document",".","This","has","the","added","benefit","that","any","fields","specified","with","`","no_index","`","will","not","be","reindexed","again",".","Implies","`","replace","`","-","*","*","language","*","*",":","Specify","the","language","used","for","document","tokenization",".","-","*","*","no_create","*","*",":","if","True",",","the","document","is","only","updated","and","reindexed","if","it","already","exists",".","If","the","document","does","not","exist",",","an","error","will","be","returned",".","Implies","`","replace","`","-","*","*","fields","*","*","kwargs","dictionary","of","the","document","fields","to","be","saved","and\/or","indexed",".","NOTE",":","Geo","points","shoule","be","encoded","as","strings","of","``","lon",",","lat","''"]
code: def add_document(
      self,
      doc_id: str,
      nosave: bool = False,
      score: float = 1.0,
      payload: bool = None,
      replace: bool = False,
      partial: bool = False,
      language: Optional[str] = None,
      no_create: str = False,
      **fields: List[str],
  ):
      """
      Add a single document to the index.
  
      ### Parameters
  
      - **doc_id**: the id of the saved document.
      - **nosave**: if set to true, we just index the document, and don't
                    save a copy of it. This means that searches will just
                    return ids.
      - **score**: the document ranking, between 0.0 and 1.0
      - **payload**: optional inner-index payload we can save for fast
      i              access in scoring functions
      - **replace**: if True, and the document already is in the index,
      we perform an update and reindex the document
      - **partial**: if True, the fields specified will be added to the
                     existing document.
                     This has the added benefit that any fields specified
                     with `no_index`
                     will not be reindexed again. Implies `replace`
      - **language**: Specify the language used for document tokenization.
      - **no_create**: if True, the document is only updated and reindexed
                       if it already exists.
                       If the document does not exist, an error will be
                       returned. Implies `replace`
      - **fields** kwargs dictionary of the document fields to be saved
                       and/or indexed.
                   NOTE: Geo points shoule be encoded as strings of "lon,lat"
      """  # noqa
      return self._add_document(
          doc_id,
          conn=None,
          nosave=nosave,
          score=score,
          payload=payload,
          replace=replace,
          partial=partial,
          language=language,
          no_create=no_create,
          **fields,
      )
  
imports: import itertools
  import time
  from typing import Dict, List, Optional, Union
  from redis.client import Pipeline
  from redis.utils import deprecated_function
  from ..helpers import get_protocol_version, parse_to_dict
  from ._util import to_string
  from .aggregation import AggregateRequest, AggregateResult, Cursor
  from .document import Document
  from .query import Query
  from .result import Result
  from .suggestion import SuggestionParser
label_desc: Use image node_id 15 for calling the SearchCommands obj's underlying member method code with example usage: obj.add_document(doc_id, nosave, score, payload, replace, partial, language, no_create) and returns: self