Skip to content

Commit

Permalink
Merge pull request #42 from hsf-training/opensearch
Browse files Browse the repository at this point in the history
closing some issues
  • Loading branch information
michmx authored Sep 4, 2024
2 parents 5d1e382 + 2b7f0eb commit a96f381
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 57 deletions.
42 changes: 25 additions & 17 deletions CITATION
Original file line number Diff line number Diff line change
@@ -1,30 +1,38 @@
cff-version: 1.2.0
message: "Please cite the following works when using this software."
type: software
title: "Matplotlib for HEP"
abstract: "A training module that introduces Matplotlib and commonly used plots in HEP."
title: "Introduction to Databases for HEP"
abstract: "A training module that introduces database management system (SQL and NoSQL) with examples in HEP."
authors:
- family-names: "Oan Evans"
given-names: "Meirin"
orcid: "https://orcid.org/0000-0002-4259-018X"
affiliation: "University of Sussex"
- family-names: "García Hernández"
given-names: "Marcela"
orcid: "https://orcid.org/0000-0003-2393-3367"
affiliation: "Center for Research and Advanced Studies of the National Polytechnic Institute"
- family-names: "Panta"
given-names: "Anil"
orcid: "https://orcid.org/0000-0001-6385-7712"
affiliation: "Thomas Jefferson National Accelerator Facility"
- family-names: "Enrique Hernández Villanueva"
given-names: "Michel"
orcid: "https://orcid.org/0000-0002-6322-5587"
affiliation: "Brookhaven National Laboratory"
- family-names: "Mashinistov"
given-names: "Ruslan"
orcid: "https://orcid.org/0000-0001-7925-4676"
affiliation: "Brookhaven National Laboratory"
- family-names: "Skipsey"
given-names: "Sam"
orcid: ""
affiliation: ""
- family-names: "Antonio Fidalgo-Rodríguez"
given-names: "Guillermo"
orcid: "https://orcid.org/0000-0001-8605-9772"
affiliation: "University of Puerto Rico, Mayagüez Campus"
- family-names: "Moreno Briceño"
given-names: "Alexander"
orcid: "https://orcid.org/0000-0001-8415-2543"
affiliation: "Universidad Antonio Nariño"
repository-code: "https://github.com/hsf-training/hsf-training-matplotlib"
url: "https://hsf-training.github.io/hsf-training-matplotlib/"
- family-names: "Lukashenko"
given-names: "Valeriia"
orcid: "https://orcid.org/0000-0002-0630-5185"
affiliation: "Institute for Nuclear Research"
repository-code: "https://github.com/hsf-training/hsf-training-databases-basics"
url: "https://github.com/hsf-training/hsf-training-databases-basics"
keywords:
- hep
- matplotlib
- database
- python
- training
license: "CC-BY-4.0"
14 changes: 8 additions & 6 deletions _episodes/02-sql-basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ title: "MySQL Basics"
teaching: x
exercises: x
questions:
- ""
- ""
- "What are the core SQL commands you need to know to interact with a MySQL database?"
- "How do you create, update, and delete records in a MySQL database?"
objectives:
- ""
- ""
- "Understand the basic SQL commands used in MySQL."
- "Learn how to create a database and tables in MySQL."
- "Practice inserting, updating, and deleting records in a MySQL table."
keypoints:
- ""
- ""
- "SQL commands are the building blocks for interacting with a MySQL database."
- "Creating a database and tables is the first step in structuring your data."
- "Inserting, updating, and deleting records allows you to manage data effectively."
---


Expand Down
10 changes: 2 additions & 8 deletions _episodes/09-opensearch-queires.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@ title: "Opensearch Queries"
teaching: x
exercises: 6
questions:
- ""
- ""

- "How to perform indexing in Opensearch?"
- "How to query and filter records in opensearch?"
objectives:
- "Understand the basic structure of Opensearch queries."
- "Learn how to create and manage indices in Opensearch."
- "Practice using different types of queries such as term queries, range queries, and compound queries."
- "Gain familiarity with updating and deleting documents in Opensearch."

keypoints:
- "Opensearch queries can be used to search, update, and delete documents in an Opensearch index."
- "Indices in Opensearch define the structure and mapping of documents."
Expand Down Expand Up @@ -228,7 +226,6 @@ for hit in search_results["hits"]["hits"]:
> > ```python
> > search_query = {"query": {"term": {"data_type": "mc"}}}
> > search_results = es.search(index=index_name, body=search_query)
> > for hit in search_results["hits"]["hits"]:
print(hit["_source"]["filename"])
> > ```
Expand Down Expand Up @@ -288,7 +285,6 @@ for hit in search_results["hits"]["hits"]:
> > }
> > }
> > search_results = es.search(index=index_name, body=search_query)
> > for hit in search_results["hits"]["hits"]:
> > print(hit["_source"]["filename"])
> > ```
Expand Down Expand Up @@ -417,7 +413,6 @@ for hit in search_results["hits"]["hits"]:
> > }
> > }
> > search_results = es.search(index=index_name, body=search_query)
> > for hit in search_results["hits"]["hits"]:
print(hit["_source"]["filename"])
> > ```
Expand Down Expand Up @@ -460,7 +455,6 @@ for hit in search_results["hits"]["hits"]:
> > }
> > }
> > search_results = es.search(index=index_name, body=search_query)
> > for hit in search_results["hits"]["hits"]:
print(hit["_source"]["filename"])
> > ```
Expand Down
6 changes: 2 additions & 4 deletions _episodes/10-text-based-search.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ title: "Opensearch Text Based Queries"
teaching: x
exercises: 2
questions:
- ""
- ""
- "How to perform text based search in opensearch?"
- "What are the ways to do text based search in opensearch?"

objectives:
- "Understand the fundamental query types in Opensearch for text-based searches."
Expand Down Expand Up @@ -62,7 +62,6 @@ for hit in search_results["hits"]["hits"]:
> > }
> >}
> > search_results = es.search(index=index_name, body=search_query)
> > for hit in search_results["hits"]["hits"]:
print(hit["_source"]["filename"])
> > ```
Expand Down Expand Up @@ -138,7 +137,6 @@ for hit in search_results["hits"]["hits"]:
> > }
> >}
> > search_results = es.search(index=index_name, body=search_query)
> > for hit in search_results["hits"]["hits"]:
print(hit["_source"]["filename"])
> > ```
Expand Down
22 changes: 0 additions & 22 deletions setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,28 +106,6 @@ at the [official documentation](https://mariadb.org/). At the time of writing th
commands are compatible with each other.


# Elasticsearch setup

## Option 1: Use a Docker container
```bash
docker run -d --name=myelasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.15.2
```

> ## TODO:
> instruct user to make it secure
{: .caution}

```bash
docker exec -it myelasticsearch /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic
```

To test that if everything is up and running, execute the following command:
```bash
curl -X GET "http://localhost:9200/"
```
If Elasticsearch is running, you'll receive a JSON response with server information.


# Opensearch setup

```bash
Expand Down

0 comments on commit a96f381

Please sign in to comment.