
    Nwg                     >    d dl mZ d dlmZ ddlmZ  G d de      Zy)    )call_command)BaseCommand   )DEFAULT_MAX_RETRIESc                       e Zd ZdZd Zd Zy)CommandzPCompletely rebuilds the search index by removing the old data and then updating.c           	      0   |j                  ddddd       |j                  ddd	g d
       |j                  dddt        d       |j                  ddddd       |j                  dddt        d       |j                  ddddt        t        d       y )Nz	--noinputstore_falseinteractiveTzRIf provided, no prompts will be issued to the user and the data will be wiped out.)actiondestdefaulthelpz-uz--usingappendzdUpdate only the named backend (can be used multiple times). By default all backends will be updated.)r   r   r   z-kz	--workersr   zVAllows for the use multiple workers to parallelize indexing. Requires multiprocessing.)r   typer   z
--nocommitcommitz&Will pass commit=False to the backend.z-bz--batch-size	batchsizez!Number of items to index at once.)r   r   r   z-tz--max-retriesstoremax_retrieszHMaximum number of attempts to write to the backend when an error occurs.)r   r   r   r   r   )add_argumentintr   )selfparsers     a/var/www/horilla/myenv/lib/python3.12/site-packages/haystack/management/commands/rebuild_index.pyadd_argumentszCommand.add_arguments
   s     e 	 	
 	7 	 	
 	i 	 	
 	 9 	 	
 	4 	 	
 	'[ 	 	
    c                     |j                         }|j                         }dD ]  }||=  dD ]  }||=  t        di | t        di | y )N)r   workersr   )r   )clear_index)update_index)copyr   )r   optionsclear_optionsupdate_optionskeys        r   handlezCommand.handle9   s\     : 	#Cc"	## 	$Cs#	$4m46~6r   N)__name__
__module____qualname__r   r   r&    r   r   r   r      s    ]D-
^7r   r   N)django.core.managementr   django.core.management.baser   r    r   r   r*   r   r   <module>r-      s    / 3 -:7k :7r   