# Tutorial: Building Your First Document Search App

This tutorial teaches you how to build a document search system in the easiest and fastest possible way. It uses the UI for uploading the sample files and a template for creating the document retrieval pipeline.

***

- **Level**: Beginner
- **Time to complete**: 10 minutes
- **Prerequisites**: 
  - This tutorial assumes a basic knowledge of language models.
  - You must be an Admin to complete this tutorial.
  - Make sure you have a <ProductShortName/> workspace where the information retrieval pipeline will run.
- **Goal**: After completing this tutorial, you will have built a complete English document retrieval system from scratch that can fetch NHS documents.

***

## Upload Files

First, let's get the files the search will run on into <ProductName/>.

1. Download the <a href="https://drive.google.com/file/d/1nrPBif9PTe2_VEcAJ2xMnZhdaxOxUhhg/view?usp=sharing" target="_blank">.zip file from gdrive</a> and unzip it to a location on your computer.
2. Log in to <a href="https://cloud.deepset.ai" target="\_blank"><ProductName/></a>, switch to the right workspace, and go to _Files_. 

<ClickableImage
  src="/img/tutorials/tutorial_first_doc_search_files.png"
  alt="The left navigation with step one on the workspace name and step two on the Files option."
  size="large"
/>
 
3. Click **Upload Files**, drag the files you unpacked in step 1, and drop them to the Upload Files window. (You must select all files in a folder; <ProductName/> doesn't support uploading folders.)
4. Click **Upload** and wait until the upload finishes. Even when the upload is finished, the files may take a while to show up in <ProductShortName/>. That's expected; just wait a while and refresh the page if needed.

**Result**: Your files have been uploaded and are shown on the Files page. You should have 953 files.

<ClickableImage
  src="/img/tutorials/tutorial_first_doc_search_number_of_files.png"
  alt="The Files page with the NHS files uploaded."
  size="large"
/>

<CreateIndex />

## Create a Pipeline

The next step is to define the components of your search app. We'll use a document search pipeline template with a vector retriever to create the pipeline.

1. In the navigation, go to **Pipeline Templates**.
2. Choose _Document Search_ as the category, find _Semantic Document Search_, and click **Use Template**. 

<ClickableImage
  src="/img/tutorials/semantic_doc_search_template.png"
  alt="The Pipeline Templates page with the Semantic Document Search template shown."
  size="standard"
/>

3. Type _NHS_doc_search_ as the pipeline name and click **Create Pipeline**. You're redirected to Builder.
4. Open the Issues panel at the bottom of the canvas. You can see one issue there: Pipeline index missing error. Click **Inspect** next to it to jump to the component that needs the index.

  <ClickableImage
    src="/img/tutorials/tutorial-missing-index.png"
    alt="The Issues panel with the Pipeline index missing error."
    size="large"
  />
5. On the `OpenSearchDocumentStore` component card, choose the `standard-index` you previously created from the list.

<ClickableImage
  src="/img/tutorials/indexes-choose-index-tutorials.png"
  alt="The index selection on the document store card"
  size="large"
/>

6. To quickly test your pipeline, zoom in, click **Run Pipeline** above the `Input` component and type "How do I treat atopic skin?". You should see the results in the chat window.

<ClickableImage
  src="/img/how-tos/run-pipeline.png"
  alt="The Run button in Pipeline Builder"
  size="large"
/>

**Result**: You created a pipeline with an index, which means your documents have been indexed, and you can now run searches on them. 
Your pipeline is at the development service level. Let's test it.
<ClickableImage
  src="/img/tutorials/nhs_docsearch.png"
  alt="The Pipelines page with the NHS doc retrieval pipeline shown as indexed and deployed"
  size="standard"
/>

## Test Your Pipeline

Before testing your pipeline, deploy it first. Click **Deploy** in the upper right corner of Builder. Wait until your pipeline status changes to *Deployed*.

When your pipeline is deployed:
1. In Builder, click **Playground**.
2. Choose _Current draft_ as the pipeline version.
3. Type queries related to health and check the documents retrieved. You can check the logs to see the retrieved documents. 

<ClickableImage
  src="/img/tutorials/tutorial-check-logs.png"
  alt="The logs tab on the pipeline details page"
  size="standard"
/>

4. To share your pipeline with others:
  1. Click **Deploy** and choose the version to deploy. 
  2. Once the pipeline is deployed, you'll see the **Share** button in Playground. 
  3. Click **Share** and configure the settings for the shared pipeline. Sharing creates a link to the pipeline chat view that others can access and try without creating an account. For more information, see [Share a Pipeline Prototype](/docs/how-to-guides/evaluating-your-pipeline/share-a-pipeline-prototype.mdx).

**Result**: Congratulations! You have built a search system that can retrieve documents related to health. You can now ask health-related queries, and it will find relevant documents.

## What's Next

Your pipeline is now a development pipeline. Once it's ready for production, change its service level to _Production_. You can do this on the Pipeline Details page shown after clicking a pipeline name. To learn more, see [Pipeline Hosting Settings](/docs/concepts/about-pipelines/about-pipelines.mdx#pipeline-hosting-settings).
