An open API service indexing awesome lists of open source software.

https://github.com/svrooij/az-cog-cli


https://github.com/svrooij/az-cog-cli

Last synced: 23 days ago
JSON representation

Awesome Lists containing this project

README

        

# Azure Cognitive Search CLI

Allowing you to index blog posts right from you pipeline.

# GitHub Action: Azure Cognitive Search Index

Index local json files and send them to your Azure Cognitive Search Service

## Using this action

```yaml
- uses: svrooij/az-cog-cli@main
with:
# The location of the folder to index
folder: ""

# The endpoint of your Azure Search Service
endpoint: ""

# The Admin API Key, needed for uploading documents
apiKey: ""

# What files to look for
# Default: index.json
query: ""

# IndexName to send the items to
# Default: blog-1
index: ""
```

## Inputs

| **Input** | **Description** | **Default** | **Required** |
| -------------- | ------------------------------------------------- | ------------ | ------------ |
| **`folder`** | The location of the folder to index | | **true** |
| **`endpoint`** | The endpoint of your Azure Search Service | | **true** |
| **`apiKey`** | The Admin API Key, needed for uploading documents | | **true** |
| **`query`** | What files to look for | `index.json` | **false** |
| **`index`** | IndexName to send the items to | `blog-1` | **false** |

Set the `endpoint` and `apiKey` through secrets e.g. `endpoint: ${{ secrets.AZURE_SEARCH_ENDPOINT }}`

## Docker: Azure Cognitive Search Index

This app is also published as a docker container, you can run as follows.

Use `{platform-specific-part} index folder {location-of-mapped-folder} --endpoint https://{searchService}.search.windows.net --apiKey xxx`

Or run `docker run --rm ghcr.io/svrooij/az-cog-cli:dev index folder --help` for more details.

```text
> docker run --rm ghcr.io/svrooij/az-cog-cli:dev index folder --help
Description:
Add data in a folder to your index

Usage:
az-cog-cli index folder [options]

Arguments:
Folder to look for files

Options:
--query What files to look for [default: index.json]
--index Which index shall be used? [default: blog-1]
--endpoint Specify the endpoint
--apiKey Specify the Admin API Key
-?, -h, --help Show help and usage information
```

### Windows (using PowerShell)

```PowerShell
docker run --rm -v ${PWD}:/usr/my-folder ghcr.io/svrooij/az-cog-cli index folder /usr/my-folder --endpoint https://{searchService}.search.windows.net --apiKey xxx
```

### Linux

```bash
docker run --rm -v $(pwd):/usr/my-folder ghcr.io/svrooij/az-cog-cli index folder /usr/my-folder --endpoint https://{searchService}.search.windows.net --apiKey xxx
```