Indexer¶
Purpose¶
The Indexer sends requests to the MQ Consumer to index objects. In day to day operations the indexer is not needed as the system maintains the index as objects are updated. The indexer is most often used when the structure of the index is changed, and a bulk reindex operation is required.
$ bin/indexer -help
usage: Indexer
-all Index all objects
-D <property=value> use value for given property, eg -D
log4j.configuration=file:path/to/config
-date <arg> Only index objects updated after YYYY-MM-DD
-delete Delete all objects in the index first
-help Print this help information
-minutes <arg> Index objects updated in the past X minutes
-P <property=value> use value for given property, specify env with -P
env=demo
-reset Reset any object in the INDEX_QUEUED state
-type <arg> REQUIRED: Object type to index - all, job, jacket,
trade, etc
Available Index Types:
ALL
JOB
TRADE
JACKET
THIRD_PARTY_CONTACT
THIRD_PARTY_COMPANY
USER_EMAIL
THIRD_PARTY_OPPORTUNITY
THIRD_PARTY_ACTIVITY
THIRD_PARTY_CONTACT_ATTACHMENT
THIRD_PARTY_COMPANY_ATTACHMENT
Parameters¶
-help Display the above help message -type Required Select which document types to index -all Index all documents of the selected type -date Index all documents updated on or after the date given, YYYY-MM-DD -minutes Index all documents update on or after M minutes ago -reset Update all rows for the specified types index status from 0 (in progress) to 1 (index queued). This has no effect at the moment. -delete Currently not implemented due to a change in ElasticSearch. -D Advanced: Used to override Java system properties for the program. Also used to override Tapestry Symbols. -P Advanced: Actually set by the shell script, bin/batch-jobs to designate which environment the program is running in. This should not be overridden.
Tip
A helpful usage of this option is to add -Dhibernate.show_sql=true to any command, which will cause any SQL that is executed to be written to standard output.
Examples¶
$ # Index all jackets
$ bin/indexer -type jacket -all
$ # Index trades update after 1/1/2016
$ bin/indexer -type trade -date 2016-01-01
$ # Index all types updated in the last 10 minutes
$ bin/indexer -type all -minutes 10