An application for indexing WordPress Trac into an Elasticsearch cluster.
Uses:
This code is used to support the Elasticsearch instance behind https://tracsearch.wpteamhub.com.
These instructions assume you already have an Elasticsearch cluster up and running.
- Clone this repository
git clone [email protected]:earnjam/wp-elastracsearch.git
- Install dependencies using composer:
cd wp-elastracsearch
composer install
- Rename or copy
config-sample.php
toconfig.php
and update the values as required.
Note: This script uses Trac's XML-RPC API to pull ticket data, which requires authentication.
I would recommend creating a new wordpress.org account to be used for this purpose in order to separate it from any personal account.
username
andpassword
are for the wordpress.org account to be usedhosts
is an array of your Elasticsearch cluster nodesindex
defaults towptrac
, but can be named anythingtype
should stay as_doc
unless you are using an older version of Elasticsearch that still supports custom document types.
- Run the
create-index.sh
script to set up the required index and proper mapping types
./bin/create-index.sh
- Build the initial index. Note: This will take several hours to index all 45000+ tickets
./bin/build-index
- Set up a cron task to update the index using the
update-index
script.