# Getting Started

## Setting up your Environment

The fastest way to see Wuha in action is with a local ElasticSearch cluster and a Wuha instance running next to it. This is easy to do with Docker. If you're not familiar with Docker, [you can learn more about it here.](https://docs.docker.com/install)

We're going to run 2 Docker containers: ElasticSearch and Wuha. First, to make sure that these 2 containers can talk to each other, we're going to create a Docker network.

```
docker network create wuha
```

Next, run a local ElasticSearch cluster with the following Docker command:

```
docker run --rm -it -p "9200:9200" --network="wuha" --network-alias="elasticsearch" wuhaio/elasticsearch
```

This ElasticSearch image is managed by Wuha, and is based on the official ElasticSearch image. We've added our ElasticSearch plugin and configured the cluster specifically to be ran as a single node local cluster. In production, this image is not necessary as you'll have your own cluster running.

We also configured ElasticSearch to expose port 9200 on your local machine so you can see what's going on, and to connect to the Docker network so Wuha can talk to the cluster.

You'll need to wait until ElasticSearch has correctly started before continuing. When you can access <http://localhost:9200> correctly, that means ElasticSearch is running.

Once ElasticSearch is running correctly, **open a new terminal window** and run the Wuha application:

```
docker run --rm -it -p "8200:8200" -p "8201:8201" --network="wuha" wuhaio/wuha
```

Both ElasticSearch and Wuha should now be running correctly, you can test it by accessing the Wuha application at <http://localhost:8200>

## Creating your first Index

Like ElasticSearch, you store information in Wuha in an **index** (or in several **indices**). An index has 2 properties:

1. A name, which you use to identify what you're storing.
2. A Wuha schema, which defines the format of data being stored.

Let's jump straight in. Assuming you have Wuha running (see our Getting Started guide), open up the Wuha interface (typically <http://localhost:8200>). Create your index by giving it a name (all lowercase, no spaces) and selecting a schema. We're going to call our index `my_demo` and use the `demo` schema (which comes built-in with Wuha).

![](/files/-LaUnu0NbAW4Ztc9S2x8)

Once you've created your index, you'll see it appear in the table below.

![](/files/-LaUo9ntn4fZ9VWlFVvj)

And that's it! The index is created and you're ready to start storing data.

## Storing Data

Here's an example document that we want to index. Our index has been created with the built-in `demo` schema, so we need to make sure our document is correctly formatted to that schema.

```
POST http://localhost:8201/index/wuha_demo_my_demo
{
  "title": "Business Plan February 2018",
  "contents": "Our business plan for February 2018 is to grow from $10K MRR to $15k MRR. We will do this by doubling our client base."
}
```

and the equivalent cURL:

```
curl \
  -X POST \
  --header "Content-Type: application/json" \
  --data '{ "title": "Business Plan February 2019", "contents": "Our business plan for February 2018 is to grow from $10K MRR to $15k MRR. We will do this by doubling our client base." }' \
  http://localhost:8201/index/wuha_demo_my_demo
```

## Searching

Now that we've stored a document, we can search for it. This quickest way to search is by using the Wuha interface. Open up <http://localhost:8200> again go to the search page.

![](/files/-LaUphvXJUTkPjMG8DaN)

## Next Steps

Now you've seen how Wuha works from beginning to end, it's time to dig a bit deeper into the different subjects.

{% content-ref url="/pages/-L\_I3RsVQBDQZ9fLuDL-" %}
[Indices & Schemas](/api/concepts/creating-an-index.md)
{% endcontent-ref %}

{% content-ref url="/pages/-LXsfSGD92IkCGw3qau8" %}
[Searching](/api/concepts/searching.md)
{% endcontent-ref %}

{% content-ref url="/pages/-LXsfRLCU54V49JuBH0m" %}
[Introduction to Storing](/api/indexing-your-data-1/indexing-your-data.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wuha.gitbook.io/api/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
