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 git@github.com:earnjam/wp-elastracsearch.git
- Install dependencies using composer:
cd wp-elastracsearch
composer install
- Rename or copy
config-sample.phptoconfig.phpand 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.
usernameandpasswordare for the wordpress.org account to be usedhostsis an array of your Elasticsearch cluster nodesindexdefaults towptrac, but can be named anythingtypeshould stay as_docunless you are using an older version of Elasticsearch that still supports custom document types.
- Run the
create-index.shscript 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-indexscript.