vania-janet/multiturn-rag-retrieval-data huggingface dataset:
Using IBM Cloudant Query 

In this tutorial, we demonstrate how to create an index and use the index to query the database. You also learn to create different types of queries to more easily find data.

Here you run the commands from the command line, but you can also complete these tasks with the IBM® Cloudant® for IBM Cloud® Dashboard, which gives you a visual example of each task. For more information about the dashboard, see [Using the IBM Cloudant Dashboard](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-creating-an-ibm-cloudant-query) tutorial.



 Before you begin 

Before you begin, follow these tutorials to create an instance, and then create and populate a database.



1. [Create an IBM Cloudant instance](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-getting-started-with-cloudantcreating-an-ibm-cloudant-instance-on-ibm-cloud).
2. [Create a database](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-creating-and-populating-a-simple-ibm-cloudant-database-on-ibm-cloudcreating-a-database-within-the-service-instance).
3. [Populate the database](https://cloud.ibm.com/docs/services/Cloudant?topic=Cloudant-creating-and-populating-a-simple-ibm-cloudant-database-on-ibm-cloudstoring-a-small-collection-of-data-as-documents-within-the-database).
4. (Optional) [Create an acurl alias](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-working-with-curlencode-user-name-and-password).



If you decide not to set up acurl, use the following URL with curl instead of the one provided in the exercises, curl "https://$USERNAME:$PASSWORD@$ACCOUNT.cloudant.com/databasedemo".
(https://cloud.ibm.com/docs-content/v1/content/522c6f62358b063f921283400a601c3f9bc66f08/Cloudant/tutorials/images/img0005b.png)

Figure 2. IBM Cloudant service name and credentials

(In this example, the instance name is Cloudant-o7.) Verify that the resource group and authentication methods are correct. Add a tag if you like. The authentication methods that are available include IAM or IAM and legacy credentials. For more information, see [authentication methods](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-managing-access-for-cloudant).

The IBM Cloudant team encourages you to use IAM access controls over IBM Cloudant legacy authentication whenever possible.
5. Select your plan.
6. To create the service, click Create:

After you click Create, the system displays a message to say that the instance is being provisioned, which returns you to the Resource list. From the Resource list, you see that the status for your instance is, Provision in progress.
7. After you create an instance, the status changes to Active.
8. Click the instance, and proceed to the next section, [Creating service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-getting-started-with-cloudantcreating-service-credentials).







 Step 2: Creating service credentials 



1. For more information about where to find your credentials, see [Locating your credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentialslocating-your-service-credentials).
2. See more information on [Understanding your service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentialsthe-service-credentials).
3.
Type Cloudant in the Search bar and open it.
4. Select the Cloudant offering.
5. Select an environment.

For Dedicated Hardware provisioned instances, you can select from the major IBM Cloud regions in the IBM Cloud Dashboard. However, the actual physical location of the Dedicated Hardware instance is dictated by the location parameter in a later step.



1. Click Dedicated.
2. Click Create Host.

Zoom

![Create a host by clicking the Create host button.](https://cloud.ibm.com/docs-content/v1/content/522c6f62358b063f921283400a601c3f9bc66f08/Cloudant/tutorials/images/img0005d.png)

Figure 1. Host selection
3. Select from the IBM Cloud regions.



6. Configure the Host.



1. Select a location for deployment.

This location is the physical location of the instance, which can be in any IBM Cloud location, including locations outside the major regions. For more information, see [IBM® global data centers](https://www.ibm.com/cloud/data-centers/).
2. Select Yes or No to answer whether HIPAA is required.

HIPAA is only valid for US locations. IBM® can provision a Dedicated Hardware plan environment to implement HIPAA controls. An environment is only created upon confirmation of a Business Associate Agreement (BAA) that is established with IBM. For more information, see [Enabling the HIPAA Supported setting](https://cloud.ibm.com/docs/account/eu_hipaa_supported.htmlenabling-the-hipaa-supported-setting) and the Service Description terms for more details. Provisioning a cluster to manage HIPAA data can take longer than the estimated 5-day period.
3. Select a key management service instance.

All IBM Cloudant environments are encrypted.
If you're using IBM Cloudant legacy authentication, you must use [API keys](https://cloud.ibm.com/apidocs/cloudantintroduction) rather than account-level credentials for programmatic access and replication jobs.





 IBM Cloudant Dashboard 

You can open the IBM Cloudant Dashboard for your instance by going to the Manage tab of the IBM Cloud Dashboard instance details page. You can use either Launch or Launch Cloudant Dashboard to open the dashboard in a new browser tab. You can do the following tasks by using the IBM Cloudant Dashboard:



* Monitor your current consumption of the instance.
* Perform create, read, update, and delete on IBM Cloudant databases, documents, and indexes.
* Set up and view replication jobs.
* View active tasks.
* View and update account information like provisioned throughput capacity, announcements, CORS, and settings.







 Programmatic access 



 Command line (curl) 

You can leverage the curl command-line utility to access the IBM Cloudant HTTPS API.

For more information about IBM Cloudant legacy authentication, see the [API & SDK reference](https://cloud.ibm.com/apidocs/cloudant). In the API reference examples, you find details on supplying a username and password to access the IBM Cloudant API with curl.

If you use IBM Cloud IAM authentication, you must first get an IBM Cloud IAM token by using an API key. Then, you pass the IAM token to the IBM Cloudant instance to authenticate. For more information, see [Passing an IBM Cloud IAM token to authenticate with a service's API](https://cloud.ibm.com/docs/account?topic=account-iamapikeysforservicestoken_auth) tutorial.

You can't use an IAM API key directly to authenticate against IBM Cloudant.





 Client libraries 

IBM Cloudant has official client libraries for Java™, Node.js, Python, Swift, and Mobile.
[Using a Dedicated Hardware plan instance](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-creating-and-leveraging-an-ibm-cloudant-dedicated-hardware-plan-instance-on-ibm-cloud)Using a Dedicated Hardware plan instance

This tutorial shows you how to create an IBM® Cloudant® for IBM Cloud® Dedicated Hardware plan instance that uses the IBM Cloud® Dashboard.

Cloudant



* 20 minutes
* 2023-03-30



[Using IBM Cloudant Query](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-creating-an-ibm-cloudant-query)Using IBM Cloudant Query

In this tutorial, we demonstrate how to create an index and use the index to query the database. You also learn to create different types of queries to more easily find data.

Cloudant



* 10 minutes
* 2023-04-11



[Creating an instance with CLI](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-creating-an-ibm-cloudant-instance-on-ibm-cloud-by-using-the-ibm-cloud-cli)Creating an instance with CLI

This tutorial shows you how to create an IBM® Cloudant® for IBM Cloud® service instance on IBM Cloud® by using the IBM Cloud CLI.

Cloudant



* 20 minutes
* 2023-03-30



[Locating your Db2 Warehouse on Cloud credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-db2-warehouse-credentials)Locating your Db2 Warehouse on Cloud credentials

To find alternatives to IBM Cloudant's IBM® Db2® Warehouse on Cloud feature, see the data-flow-examples repository for tutorials on extracting IBM Cloudant documents and writing the data to a Db2 Warehouse on Cloud table.

Cloudant



* 20 minutes
* 2023-03-30



[Locating your service credentials](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-locating-your-service-credentials)Locating your service credentials
IBM Cloudant is offered as either a [Shared Plan](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-ibm-cloudant.comshared-plan) or an [Enterprise (Dedicated) Plan](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-ibm-cloudant.comenterprise-plan), and as an [IBM Cloud® service](https://www.ibm.com/cloud/).

The IBM Cloudant Shared Plan and Enterprise (Dedicated) Plan offerings aren't available on the IBM Cloud service.



 Enterprise plan 

With the IBM Cloudant DBaaS Enterprise Plan, you have access to all the IBM Cloudant DBaaS capabilities, provided through a dedicated, single-tenant cluster.

This plan gives you assured database performance and up-time, by using dedicated DBaaS clusters or hardware available at various hosting locations.

For users of the Enterprise plan who require a new or extra IBM Cloudant account on one of their dedicated clusters, sign up on the [IBM Cloudant Enterprise account sign-up page](https://cloudant.com/enterprise-sign-up).
Create an account by using the form, and open a support ticket to request that support move your account to one of your IBM Cloudant Enterprise dedicated clusters.





 Shared plan 

The IBM Cloudant Shared Plan is being retired on 31 March 2018. Starting 24 July 2017, no new Shared Plan accounts can be created on the [IBM Cloudant website](https://www.ibm.com/cloud/cloudant).

With the IBM Cloudant Shared Plan, you have access to all the IBM Cloudant DBaaS capabilities, provided through a shared or 'multi-tenant' cluster.

Pricing is metered, based on your monthly usage. No charge applies if your monthly usage is under $50.00 (starting August 2016). For more information, see the [IBM Cloudant Shared Plan Terms of Service](https://cloudant.com/assets/terms.pdf).
Getting started with solution tutorials 

Solution tutorials provide step-by-step instructions on how to use IBM Cloud to implement common patterns based on best practices and proven technologies.

Before going through the tutorials collection, this guide will help you set up your development environment to successfully follow the instructions of the guides found in this collection.



 Objectives 

Install must-have tools to be productive with IBM Cloud:



* IBM Cloud CLI - the command line interface to interact with IBM Cloud API.
* Docker - to deliver and run software in packages called containers.
* kubectl - a command line interface for running commands against Kubernetes clusters.
* oc - manages OpenShift applications, and provides tools to interact with each component of your system.
* Helm 3 - helps you manage Kubernetes applications — Helm Charts help you define, install, and upgrade even the most complex Kubernetes application.
* Terraform - automates your resource provisioning.
* jq - a lightweight and flexible command-line JSON processor.
* Git - a free and open source distributed version control system.



To avoid the installation of these tools, you can also use the [Cloud Shell](https://cloud.ibm.com/shell) from the IBM Cloud console.





 Microsoft Windows 

The following sections assume you are running Microsoft Windows 10 64-bit under a user with Administrator privileges. Once you're done with the specific sections, proceed to the configuration [common to all operating systems](https://cloud.ibm.com/docs/solution-tutorials?topic=solution-tutorials-tutorialsgetting-started-common).



 IBM Cloud CLI 



1. Download and install the IBM Cloud CLI from [https://github.com/IBM-Cloud/ibm-cloud-cli-release/releases/latest](https://github.com/IBM-Cloud/ibm-cloud-cli-release/releases/latest).
2. Verify the installation with:

ibmcloud version

You may need to restart your machine after the installation.







 Docker 



1. Docker Desktop on Windows is one option to run container images on Windows.
Log in to use the IBM Cloud CLI. For more information about how to log in and set a target resource group, see [log in to your IBM Cloud account](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-creating-an-ibm-cloudant-instance-on-ibm-cloud-by-using-the-ibm-cloud-clilogging-in-to-your-ibm-cloud-account).
2. Create an IBM Cloudant Standard plan instance on your IBM Cloudant Dedicated Hardware plan environment by using the following basic command format.

ibmcloud resource service-instance-create $NAME $SERVICE_NAME $PLAN_NAME $REGION [-p, --parameters @JSON_FILE | JSON_STRING ]





Table 3. Basic command format

 Field Description 

 NAME An arbitrary name that you assign the instance. 
 SERVICE_NAME cloudantnosqldb 
 PLAN_NAME standard 
 REGION The region where you want to deploy, for example, us-south, us-east, or eu-gb. 



IBM Cloudant instances that are deployed on Dedicated Hardware environments take two more parameters.



Table 4. Parameters

 Parameter Description 

 environment_crn This parameter must be set to the CRN of the IBM Cloudant Dedicated Hardware plan instance. You can determine what the CRN is by looking at the example CLI command in the Manage tab of the IBM Cloudant Dedicated Hardware plan instance in the IBM Cloud Dashboard. Or you can determine what the CRN is by using the ibmcloud resource service-instance SERVICE_INSTANCE_NAME command. 
 legacyCredentials An optional parameter that defaults to true and dictates whether the instance uses both legacy and IAM credentials or IAM credentials only. See the [IAM guide](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-managing-access-for-cloudant) for more details on choosing an authentication method. 



The following example command includes the extra parameters.
"credentials": {
"url":"CLOUDANT_DATABASE_URL"
},
"label": "cloudantNoSQLDB"
}
]
}
}
3. Find your app in the IBM Cloud [Resource List](https://cloud.ibm.com/resources). On the Service Details page for your app, click Connections in the sidebar. Click the IBM Cloudant menu icon (…) and select View credentials.
4. Copy and paste just the url value from the credentials to the url field of the vcap-local.json file, replacing CLOUDANT_DATABASE_URL.
5. From the get-started-aspnet-core/src/GetStartedDotnet directory, restart your app by running the following command.

dotnet run
6. Refresh your browser view at http://localhost:5000/. Any names you enter into the app will now get added to the database.



Your local app and the IBM Cloud app share the database. View your IBM Cloud app at the URL listed in the output of the ibmcloud cf push command. Names you add from either app should appear in both when you refresh the browsers.

Remember, if you don't need your app live, stop it so you don't incur any unexpected charges.





 Next Steps 



* [Samples](https://ibm-cloud.github.io)
* [Architecture Center](https://www.ibm.com/cloud/architecture/architectures)
Creating a web-based To-Do list 

Create a simple web-based to-do list to get familiar with the basic IBM Cloud features.



 Objectives 



1. From this tutorial, you learn how to create a basic website that interfaces with your IBM Cloud database to read and write data.

The project is a simple to-do list, where you can see a list of notes. You can add and delete notes. Each of your notes has a tag, and you can filter your notes by tag.
2. To create this to-do list, your application needs to be able to read and write to the database. To read to-dos in "newest first" order and to filter by tag, your database needs to have some secondary indexes. Now, we can create all of that.



You can complete the tutorial in less than an hour. It doesn't cost you anything over your current IBM Cloudant bill (so it's free if you are on the IBM Cloudant Lite plan).

The website that you create is served from your local machine, so no other services are required apart from IBM Cloud.

After you complete it, you have a basic understanding of how applications can interface with IBM Cloudant through an IBM Cloudant SDK (in this case, NodeJS).





 Before you begin 

You need the following implements to complete this tutorial:



1. An IBM Cloudant service instance and some service credentials. You can create the instance and credentials in the IBM Cloudant Dashboard by following the [Getting started with IBM Cloudant](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-getting-started-with-cloudant) tutorial. Be sure to make a note of the APIKey and URL when you create your service credentials.
2. Ensure you have access to a Mac or Linux™ terminal.
3. Download [Git](https://git-scm.com/downloads).
4. Download [Node.js and npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
Getting started with solution tutorials 

Solution tutorials provide step-by-step instructions on how to use IBM Cloud to implement common patterns based on best practices and proven technologies.

Before going through the tutorials collection, this guide will help you set up your development environment to successfully follow the instructions of the guides found in this collection.



 Objectives 

Install must-have tools to be productive with IBM Cloud:



* IBM Cloud CLI - the command line interface to interact with IBM Cloud API.
* Docker - to deliver and run software in packages called containers.
* kubectl - a command line interface for running commands against Kubernetes clusters.
* oc - manages OpenShift applications, and provides tools to interact with each component of your system.
* Helm 3 - helps you manage Kubernetes applications — Helm Charts help you define, install, and upgrade even the most complex Kubernetes application.
* Terraform - automates your resource provisioning.
* jq - a lightweight and flexible command-line JSON processor.
* Git - a free and open source distributed version control system.



To avoid the installation of these tools, you can also use the [Cloud Shell](https://cloud.ibm.com/shell) from the IBM Cloud console.





 Microsoft Windows 

The following sections assume you are running Microsoft Windows 10 64-bit under a user with Administrator privileges. Once you're done with the specific sections, proceed to the configuration [common to all operating systems](https://cloud.ibm.com/docs/solution-tutorialsgetting-started-common).



 IBM Cloud CLI 



1. Download and install the IBM Cloud CLI from [https://github.com/IBM-Cloud/ibm-cloud-cli-release/releases/latest](https://github.com/IBM-Cloud/ibm-cloud-cli-release/releases/latest).
2. Verify the installation with:

ibmcloud version

You may need to restart your machine after the installation.







 Docker 



1. Docker Desktop on Windows is one option to run container images on Windows.
Getting started with Go 

IBM® Cloud Foundry is deprecated and no longer supported as of 1 June 2023. For more information, see the [deprecation details](https://cloud.ibm.com/docs/cloud-foundry-public?topic=cloud-foundry-public-deprecationdep_details).

Congratulations, you deployed a Hello World sample app on IBM Cloud®! To get started, follow this step-by-step guide. Or, [download the sample code](https://github.com/IBM-Cloud/go-cloudant) and explore on your own.

By following this getting started tutorial, you'll set up a development environment, deploy an app locally on IBM Cloud®, and integrate an IBM Cloud database service in your app.

Throughout these docs, references to the Cloud Foundry CLI are now updated to the IBM Cloud CLI! The IBM Cloud CLI has the same familiar Cloud Foundry commands, but with better integration with IBM Cloud accounts and other services. Learn more about getting started with the IBM Cloud CLI in this tutorial.



 Before you begin 

You'll need the following:



* [IBM Cloud account](https://cloud.ibm.com/registration)
* [IBM Cloud CLI](https://cloud.ibm.com/docs/cli?topic=cli-install-ibmcloud-cli)
* [Git](https://git-scm.com/downloads)
* [Go](https://golang.org/dl/)







 Step 1: Clone the sample app 



1. First, we'll set up the local environment by ensuring all GO environment variables are set properly. For example:

mkdir $HOME/work
export GOPATH=$HOME/work
export PATH=$PATH:$GOPATH/bin
2. Change path to $GOPATH/src

mkdir $GOPATH/src
cd $GOPATH/src

Now you're ready to start working with the simple Go hello world app.
3.
Find your app in the IBM Cloud [resource list](https://cloud.ibm.com/resources). On the Service Details page for your app, click Connections in the sidebar. Click the IBM Cloudant menu icon (…) and select View credentials.
2. Copy and paste just the url from the credentials to the url field of the src/main/resources/cloudant.properties file, and save the changes.

cloudant_url=https://123456789 ... bluemix.cloudant.com
3. Restart the server.



Refresh your browser view at http://localhost:9080/GetStartedJava/. Any names that you enter into the app will now get added to the database.

Your local app and the IBM Cloud app are sharing the database. Names you add from either app will appear in both when you refresh the browsers.

Remember, if you don't need your app live on IBM Cloud, stop the app so you don't incur any unexpected charges.





 Next steps 

[Manage your Liberty for Java app](https://cloud.ibm.com/docs/cloud-foundry-public?topic=cloud-foundry-public-liberty_runtime). Some example tasks include:



* Configure logging and tracing.
* Install Liberty features.
* Connect services to your app.



Check out the following resources:



* [Samples](https://ibm-cloud.github.io)
* [Architecture Center](https://www.ibm.com/cloud/architecture/architectures)
The IBM Cloud Dashboard opens.
2. Click View all in the Resource summary section of the dashboard.
3. In the Services section, click the IBM Cloudant instance that you plan to monitor.

The IBM Cloudant Manage page opens.
4. Click Actions, and select Monitoring.

Zoom

![If the Actions menu includes monitoring items, then your instance is already configured for platform metrics.](https://cloud.ibm.com/docs-content/v1/content/522c6f62358b063f921283400a601c3f9bc66f08/Cloudant/images/monitoring_menu.png)

Figure 2. Monitoring menu

A new tab opens in your browser and shows the Default dashboard that is named IBM Cloudant within the context of your IBM Cloudant instance.







 Launching IBM Cloud Monitoring web UI from the Observability page 

Complete the following steps to launch the IBM Cloud Monitoring web UI from the Observability page:



1. [Launch the IBM Cloud Monitoring web UI](https://cloud.ibm.com/docs/monitoring?topic=monitoring-launch).
2. Click DASHBOARDS.
3. In the Default Dashboards section, expand IBM.
4. Choose the IBM Cloudant Dashboard from the list.

To access your deployment's IBM Cloud Monitoring Dashboard from IBM Cloud Monitoring, it's in the sidebar, under IBM.

Zoom

![Choose IBM Cloudant to open the dashboard.](https://cloud.ibm.com/docs-content/v1/content/522c6f62358b063f921283400a601c3f9bc66f08/Cloudant/images/dashboard_link.png)

Figure 3. IBM Cloudant Dashboard

Next, change the scope or make a copy of the Default dashboard to monitor an IBM Cloudant instance.









 IBM Cloudant metrics dictionary 



 HTTP request count 

The number of HTTP requests made against an IBM Cloudant instance:



Table 2. HTTP request count metric metadata