Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
jonavellecuerdo committed Feb 8, 2024
1 parent c2e23be commit e2901fc
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ TIMDEX! Index Manager (TIM) is a Python CLI application for managing TIMDEX indi
- To lint the repo: `make lint`
- To run the app: `pipenv run tim --help`

**Important note:** The sections that follow provide instructions for running OpenSearch **locally with Docker**. These instructions are useful for testing. Please make sure the environment variable `TIMDEX_OPENSEARCH_ENDPOINT` is **not** set before proceeding.

### Running OpenSearch locally with Docker

1. Run the following command:
Expand All @@ -33,7 +35,6 @@ TIMDEX! Index Manager (TIM) is a Python CLI application for managing TIMDEX indi
2024-02-08 13:22:16,930 INFO tim.cli.log_process_time(): Total time to complete process: 0:00:00.105506
```


### Running Opensearch and OpenSearch Dashboards locally with Docker

You can use the included Docker Compose file ([compose.yaml](compose.yaml)) to start an OpenSearch instance along with OpenSearch Dashboards, "[the user interface that lets you visualize your Opensearch data and run and scale your OpenSearch clusters](https://opensearch.org/docs/latest/dashboards/)". Two tools that are useful for exploring indices are [DevTools](https://opensearch.org/docs/latest/dashboards/dev-tools/index-dev/) and [Discover](https://opensearch.org/docs/latest/dashboards/discover/index-discover/).
Expand All @@ -53,6 +54,31 @@ You can use the included Docker Compose file ([compose.yaml](compose.yaml)) to s
For a more detailed example with test data, please refer to the Confluence document: [How to run and query OpenSearch locally](https://mitlibraries.atlassian.net/wiki/spaces/D/pages/3586129972/How+to+run+and+query+OpenSearch+locally).
### Indexing a record into OpenSearch locally with Docker
1. Follow the instructions in either[Running Opensearch locally with Docker](#running-opensearch-locally-with-docker) or [Running Opensearch and OpenSearch Dashboards locally with Docker](#running-opensearch-and-opensearch-dashboards-locally-with-docker).
2. Open a new terminal, and create a new index. Copy the name of the created index printed to the terminal's output.
```
pipenv run tim create -s <index-name>
```

3. Copy the index name and promote the index to the alias.

```
pipenv run tim promote -a <alias-name> -i <index-name>
```

4. Bulk index records from a specified directory (e.g., including S3).
```
pipenv run tim bulk-index -s <index-name> <filepath-to-records>
```

5. After verifying that the bulk-index was successful, clean up your local OpenSearch instance by deleting the index.
```
pipenv run tim delete -i <index-name>
```

### Running OpenSearch on AWS

1. Ensure that you have the correct AWS credentials set for the Dev1 (or desired) account.
Expand Down
5 changes: 1 addition & 4 deletions tests/fixtures/sample_records.json
Original file line number Diff line number Diff line change
Expand Up @@ -617,10 +617,7 @@
"literary_form": "nonfiction",
"locations": [
{
"geopoint": [
-77.025955,
38.942142
],
"geoshape": "BBOX (-77.11806895668957,-76.90988990509905, 38.99435963428633, 38.79162154730547)",
"kind": "Place of publication",
"value": "District of Columbia"
}
Expand Down

0 comments on commit e2901fc

Please sign in to comment.