class_docstr: Search commands.
docstr: Create the search index. The index must not already exist.
  
  ### Parameters:
  
  - **fields**: a list of TextField or NumericField objects
  - **no_term_offsets**: If true, we will not save term offsets in
  the index
  - **no_field_flags**: If true, we will not save field flags that
  allow searching in specific fields
  - **stopwords**: If not None, we create the index with this custom
  stopword list. The list can be empty
  - **max_text_fields**: If true, we will encode indexes as if there
  were more than 32 text fields which allows you to add additional
  fields (beyond 32).
  - **temporary**: Create a lightweight temporary index which will
  expire after the specified period of inactivity (in seconds). The
  internal idle timer is reset whenever the index is searched or added to.
  - **no_highlight**: If true, disabling highlighting support.
  Also implied by no_term_offsets.
  - **no_term_frequencies**: If true, we avoid saving the term frequencies
  in the index.
  - **skip_initial_scan**: If true, we do not scan and index.
  
  For more information see `FT.CREATE <https://redis.io/commands/ft.create>`_.
docstr_tok: ["Create","the","search","index",".","The","index","must","not","already","exist",".","#","#","#","Parameters",":","-","*","*","fields","*","*",":","a","list","of","TextField","or","NumericField","objects","-","*","*","no_term_offsets","*","*",":","If","true",",","we","will","not","save","term","offsets","in","the","index","-","*","*","no_field_flags","*","*",":","If","true",",","we","will","not","save","field","flags","that","allow","searching","in","specific","fields","-","*","*","stopwords","*","*",":","If","not","None",",","we","create","the","index","with","this","custom","stopword","list",".","The","list","can","be","empty","-","*","*","max_text_fields","*","*",":","If","true",",","we","will","encode","indexes","as","if","there","were","more","than","32","text","fields","which","allows","you","to","add","additional","fields","(","beyond","32",")",".","-","*","*","temporary","*","*",":","Create","a","lightweight","temporary","index","which","will","expire","after","the","specified","period","of","inactivity","(","in","seconds",")",".","The","internal","idle","timer","is","reset","whenever","the","index","is","searched","or","added","to",".","-","*","*","no_highlight","*","*",":","If","true",",","disabling","highlighting","support",".","Also","implied","by","no_term_offsets",".","-","*","*","no_term_frequencies","*","*",":","If","true",",","we","avoid","saving","the","term","frequencies","in","the","index",".","-","*","*","skip_initial_scan","*","*",":","If","true",",","we","do","not","scan","and","index",".","For","more","information","see","`","FT.CREATE","<","https",":","\/\/redis.io\/commands\/ft.create",">","`","_","."]
code: def create_index(
      self,
      fields,
      no_term_offsets=False,
      no_field_flags=False,
      stopwords=None,
      definition=None,
      max_text_fields=False,
      temporary=None,
      no_highlight=False,
      no_term_frequencies=False,
      skip_initial_scan=False,
  ):
      """
      Create the search index. The index must not already exist.
  
      ### Parameters:
  
      - **fields**: a list of TextField or NumericField objects
      - **no_term_offsets**: If true, we will not save term offsets in
      the index
      - **no_field_flags**: If true, we will not save field flags that
      allow searching in specific fields
      - **stopwords**: If not None, we create the index with this custom
      stopword list. The list can be empty
      - **max_text_fields**: If true, we will encode indexes as if there
      were more than 32 text fields which allows you to add additional
      fields (beyond 32).
      - **temporary**: Create a lightweight temporary index which will
      expire after the specified period of inactivity (in seconds). The
      internal idle timer is reset whenever the index is searched or added to.
      - **no_highlight**: If true, disabling highlighting support.
      Also implied by no_term_offsets.
      - **no_term_frequencies**: If true, we avoid saving the term frequencies
      in the index.
      - **skip_initial_scan**: If true, we do not scan and index.
  
      For more information see `FT.CREATE <https://redis.io/commands/ft.create>`_.
      """  # noqa
  
      args = [CREATE_CMD, self.index_name]
      if definition is not None:
          args += definition.args
      if max_text_fields:
          args.append(MAXTEXTFIELDS)
      if temporary is not None and isinstance(temporary, int):
          args.append(TEMPORARY)
          args.append(temporary)
      if no_term_offsets:
          args.append(NOOFFSETS)
      if no_highlight:
          args.append(NOHL)
      if no_field_flags:
          args.append(NOFIELDS)
      if no_term_frequencies:
          args.append(NOFREQS)
      if skip_initial_scan:
          args.append(SKIPINITIALSCAN)
      if stopwords is not None and isinstance(
          stopwords, (list, tuple, set)
      ):
          args += [STOPWORDS, len(stopwords)]
          if len(stopwords) > 0:
              args += list(stopwords)
  
      args.append("SCHEMA")
      try:
          args += list(
              itertools.chain(*(f.redis_args() for f in fields))
          )
      except TypeError:
          args += fields.redis_args()
  
      return self.execute_command(*args)
  
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 10 for calling the SearchCommands obj's underlying member method code with example usage: obj.create_index(fields, no_term_offsets, no_field_flags, stopwords, definition, max_text_fields, temporary, no_highlight, no_term_frequencies, skip_initial_scan) and returns: self