Відмінності між версіями «Rebuild nozebra.pl»

Матеріал з Koha Ukraine Wiki
Перейти до: навігація, пошук
(Опис)
(Опис)
 
(Не показано 5 проміжних версій цього користувача)
Рядок 8: Рядок 8:
  
 
'''-b'''  
 
'''-b'''  
:—                     index bibliographic records
+
: — індексувати бібліографічні записи
  
'''-a'''                     index authority records
+
'''-a'''
 +
: — індексувати авторитетні записи
  
 
'''    -daemon'''  
 
'''    -daemon'''  
—                Run in daemon mode.  The program will loop checking
+
: —                Run in daemon mode.  The program will loop checking for entries on the zebraqueue table, processing them incrementally if present, and then sleep for a few seconds before repeating the process  
                            for entries on the zebraqueue table, processing
+
: Checking the zebraqueue table is done with a cheap SQL query.  This allows for near realtime update of the zebra search index with low system overhead.
                            them incrementally if present, and then sleep
+
: Use -sleep to control the checking interval.
                            for a few seconds before repeating the process
+
: Daemon mode implies -z, -a, -b.  The program will refuse to start if options are present that do not make sense while running as an incremental update daemon (e.g. -r or -offset).
                            Checking the zebraqueue table is done with a cheap
 
                            SQL query.  This allows for near realtime update of
 
                            the zebra search index with low system overhead.
 
                            Use -sleep to control the checking interval.
 
 
 
                            Daemon mode implies -z, -a, -b.  The program will
 
                            refuse to start if options are present that do not
 
                            make sense while running as an incremental update
 
                            daemon (e.g. -r or -offset).
 
  
 
'''    -sleep 10'''  
 
'''    -sleep 10'''  
—              Seconds to sleep between checks of the zebraqueue
+
: —              Seconds to sleep between checks of the zebraqueue table in daemon mode.  The default is 5 seconds.
                            table in daemon mode.  The default is 5 seconds.
 
  
 
'''    -z'''  
 
'''    -z'''  
—                      select only updated and deleted
+
: —                      select only updated and deleted records marked in the zebraqueue table.  Cannot be used with -r or -s.
                            records marked in the zebraqueue
 
                            table.  Cannot be used with -r
 
                            or -s.
 
  
 
'''    --skip-deletes'''  
 
'''    --skip-deletes'''  
—          only select record updates, not record
+
: —          only select record updates, not record deletions, to avoid potential excessive I/O when zebraidx processes deletions.
                            deletions, to avoid potential excessive
+
:                             If this option is used for normal indexing, a cronjob should be set up to run
                            I/O when zebraidx processes deletions.
+
:                             rebuild_zebra.pl -z without --skip-deletes
                             If this option is used for normal indexing,
+
:                             during off hours.
                            a cronjob should be set up to run
+
:                             Only effective with -z.
                             rebuild_zebra.pl -z without --skip-deletes
 
                             during off hours.
 
                             Only effective with -z.
 
  
 
'''    -r '''  
 
'''    -r '''  
—                    clear Zebra index before
+
: —                    clear Zebra index before adding records to index. Implies -w.
                            adding records to index. Implies -w.
 
  
 
'''    -d '''  
 
'''    -d '''  
—                    Temporary directory for indexing.
+
: —                    Temporary directory for indexing.
                             If not specified, one is automatically
+
:                             If not specified, one is automatically created.  The export directory is automatically deleted unless                           you supply the -k switch.
                            created.  The export directory
 
                            is automatically deleted unless
 
                            you supply the -k switch.
 
  
 
'''    -k'''  
 
'''    -k'''  
—                      Do not delete export directory.
+
: —                      Do not delete export directory.
  
 
'''    -s'''  
 
'''    -s'''  
—                      Skip export.  Used if you have
+
: —                      Skip export.  Used if you have                           already exported the records                     in a previous run.
                            already exported the records
 
                            in a previous run.
 
  
 
'''    -nosanitize'''  
 
'''    -nosanitize'''  
—            export biblio/authority records directly from DB marcxml
+
: —            export biblio/authority records directly from DB marcxml                            field without sanitizing records. It speed up                           dump process but could fail if DB contains badly                           encoded records. Works only with -x,
                             field without sanitizing records. It speed up
 
                            dump process but could fail if DB contains badly
 
                            encoded records. Works only with -x,
 
  
 
'''    -w'''  
 
'''    -w'''  
—                      skip shadow indexing for this batch
+
: —                      skip shadow indexing for this batch
  
 
'''    -y'''  
 
'''    -y'''  
—                      do NOT clear zebraqueue after indexing; normally,
+
: —                      do NOT clear zebraqueue after indexing; normally,                            after doing batch indexing, zebraqueue should be                            marked done for the affected record type(s) so that                           a running zebraqueue_daemon doesn't try to reindex                            the same records - specify -y to override this.
                             after doing batch indexing, zebraqueue should be
+
:                             Cannot be used with -z.
                             marked done for the affected record type(s) so that
 
                            a running zebraqueue_daemon doesn't try to reindex
 
                             the same records - specify -y to override this.
 
                             Cannot be used with -z.
 
  
 
'''    -v'''  
 
'''    -v'''  
—                      increase the amount of logging.  Normally only
+
: —                      increase the amount of logging.  Normally only                           warnings and errors from the indexing are shown.
                            warnings and errors from the indexing are shown.
+
:                             Use log level 2 (-v -v) to include all Zebra logs.
                             Use log level 2 (-v -v) to include all Zebra logs.
 
  
 
'''    --length  1234'''  
 
'''    --length  1234'''  
—        how many biblio you want to export
+
: —        how many biblio you want to export
  
 
'''    --offset 1243'''  
 
'''    --offset 1243'''  
—          offset you want to start to
+
: —          offset you want to start to
                                 example: --offset 500 --length=500 will result in a LIMIT 500,1000 (exporting 1000 records, starting by the 500th one
+
:                                 example: --offset 500 --length=500 will result in a LIMIT 500,1000 (exporting 1000 records, starting by the 500th one
)
+
: )
                                 note that the numbers are NOT related to biblionumber, that's the intended behaviour.
+
:                                 note that the numbers are NOT related to biblionumber, that's the intended behaviour.
  
 
'''    --where'''  
 
'''    --where'''  
—                let you specify a WHERE query, like itemtype='BOOK'
+
: —                let you specify a WHERE query, like itemtype='BOOK'                             or something like that
                            or something like that
 
  
 
'''    --run-as-root'''  
 
'''    --run-as-root'''  
—          explicitily allow script to run as 'root' user
+
: —          explicitily allow script to run as 'root' user
  
 
'''  --wait-for-lock'''  
 
'''  --wait-for-lock'''  
—        when not running in daemon mode, the default
+
: —        when not running in daemon mode, the default                             behavior is to abort a rebuild if the rebuild                            lock is busy.  This option will cause the program                            to wait for the lock to free and then continue                            processing the rebuild request,
                            behavior is to abort a rebuild if the rebuild
 
                             lock is busy.  This option will cause the program
 
                             to wait for the lock to free and then continue
 
                             processing the rebuild request,
 
  
 
'''    --table'''  
 
'''    --table'''  
—                specify a table (can be items, biblioitems, biblio, biblio_metadata) to retrieve biblionumber to index.
+
: —                specify a table (can be items, biblioitems, biblio, biblio_metadata) to retrieve biblionumber to index.
                             biblioitems is the default value.
+
:                             biblioitems is the default value.
  
 
'''    --help or -h'''  
 
'''    --help or -h'''  
—            show this message.
+
: —            show this message.
  
 
== Джерела ==
 
== Джерела ==
 
* https://git.koha-community.org/gitweb/?p=koha.git;a=blob;f=misc/migration_tools/rebuild_zebra.pl;h=ec19ce1f5c40445dcdb7c033414fde02dcb06c2b;hb=HEAD
 
* https://git.koha-community.org/gitweb/?p=koha.git;a=blob;f=misc/migration_tools/rebuild_zebra.pl;h=ec19ce1f5c40445dcdb7c033414fde02dcb06c2b;hb=HEAD
 
* https://github.com/Koha-Community/Koha/blob/master/misc/migration_tools/rebuild_zebra.pl
 
* https://github.com/Koha-Community/Koha/blob/master/misc/migration_tools/rebuild_zebra.pl

Поточна версія на 17:31, 14 листопада 2022

Назва

rebuild_nozebra.pl — сценарій переіндексування бібліографічних та віторитетних MARC-записів у БД Zebra.

Використовуйте це пакетне завдання, щоб переіндексувати усі бібліотечні або авторитетні записи у Вашій базі даних Koha.

Опис

Параметри:

-b

— індексувати бібліографічні записи

-a

— індексувати авторитетні записи

-daemon

— Run in daemon mode. The program will loop checking for entries on the zebraqueue table, processing them incrementally if present, and then sleep for a few seconds before repeating the process
Checking the zebraqueue table is done with a cheap SQL query. This allows for near realtime update of the zebra search index with low system overhead.
Use -sleep to control the checking interval.
Daemon mode implies -z, -a, -b. The program will refuse to start if options are present that do not make sense while running as an incremental update daemon (e.g. -r or -offset).

-sleep 10

— Seconds to sleep between checks of the zebraqueue table in daemon mode. The default is 5 seconds.

-z

— select only updated and deleted records marked in the zebraqueue table. Cannot be used with -r or -s.

--skip-deletes

— only select record updates, not record deletions, to avoid potential excessive I/O when zebraidx processes deletions.
If this option is used for normal indexing, a cronjob should be set up to run
rebuild_zebra.pl -z without --skip-deletes
during off hours.
Only effective with -z.

-r

— clear Zebra index before adding records to index. Implies -w.

-d

— Temporary directory for indexing.
If not specified, one is automatically created. The export directory is automatically deleted unless you supply the -k switch.

-k

— Do not delete export directory.

-s

— Skip export. Used if you have already exported the records in a previous run.

-nosanitize

— export biblio/authority records directly from DB marcxml field without sanitizing records. It speed up dump process but could fail if DB contains badly encoded records. Works only with -x,

-w

— skip shadow indexing for this batch

-y

— do NOT clear zebraqueue after indexing; normally, after doing batch indexing, zebraqueue should be marked done for the affected record type(s) so that a running zebraqueue_daemon doesn't try to reindex the same records - specify -y to override this.
Cannot be used with -z.

-v

— increase the amount of logging. Normally only warnings and errors from the indexing are shown.
Use log level 2 (-v -v) to include all Zebra logs.

--length 1234

— how many biblio you want to export

--offset 1243

— offset you want to start to
example: --offset 500 --length=500 will result in a LIMIT 500,1000 (exporting 1000 records, starting by the 500th one
)
note that the numbers are NOT related to biblionumber, that's the intended behaviour.

--where

— let you specify a WHERE query, like itemtype='BOOK' or something like that

--run-as-root

— explicitily allow script to run as 'root' user

--wait-for-lock

— when not running in daemon mode, the default behavior is to abort a rebuild if the rebuild lock is busy. This option will cause the program to wait for the lock to free and then continue processing the rebuild request,

--table

— specify a table (can be items, biblioitems, biblio, biblio_metadata) to retrieve biblionumber to index.
biblioitems is the default value.

--help or -h

— show this message.

Джерела