Skip to content

Commit

Permalink
Add doc for data souces
Browse files Browse the repository at this point in the history
Signed-off-by: KeisukeYamashita <19yamashita15@gmail.com>
  • Loading branch information
KeisukeYamashita committed Nov 3, 2021
1 parent 0dc96ab commit b4bd5ac
Show file tree
Hide file tree
Showing 21 changed files with 177 additions and 4 deletions.
6 changes: 6 additions & 0 deletions docs/data-sources/collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ description: |-

Group of related documents which are roughly equivalent to a table in a relational database.

## Example Usage

```terraform
data "typesense_collection" "my_collection" {
name = "my-collection"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
9 changes: 8 additions & 1 deletion docs/data-sources/collection_alias.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ description: |-

Virtual collection name that points to a real collection.


## Example Usage

```terraform
data "typesense_collection_alias" "my_alias" {
name = "my-alias"
collection_name = "my-collection"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
9 changes: 8 additions & 1 deletion docs/data-sources/curation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ description: |-

Promote or exclude certain documents from a query result


## Example Usage

```terraform
data "typesense_curation" "my_curation" {
name = "my-curation"
collection_name = "my-collection"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
9 changes: 8 additions & 1 deletion docs/data-sources/synonyms.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ description: |-

Search terms that should be considered equivalent


## Example Usage

```terraform
data "typesense_synonyms" "my_synonyms" {
name = "my-synonyms"
collection_name = "my-collection"
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down
17 changes: 17 additions & 0 deletions docs/resources/collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@ description: |-

Group of related documents which are roughly equivalent to a table in a relational database.

## Example Usage

```terraform
resource "typesense_collection" "my_collection" {
name = "my-collection"
fields {
name = "name"
type = "string"
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down Expand Up @@ -43,4 +54,10 @@ Optional:
- **index** (Boolean) Index field
- **optional** (Boolean) Optional field

## Import

Import is supported using the following syntax:

```shell
terraform import typesense_collection.my_collection my-collection
```
13 changes: 13 additions & 0 deletions docs/resources/collection_alias.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@ description: |-

Virtual collection name that points to a real collection.

## Example Usage

```terraform
resource "typesense_collection_alias" "my_alias" {
name = "my-alias"
collection_name = typesense_collection.my_collection.name
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand All @@ -24,4 +31,10 @@ Virtual collection name that points to a real collection.

- **id** (String) The ID of this resource.

## Import

Import is supported using the following syntax:

```shell
terraform import typesense_collection_alias.my_alias my-alias
```
32 changes: 32 additions & 0 deletions docs/resources/curation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,33 @@ description: |-

Promote or exclude certain documents from a query result

## Example Usage

```terraform
resource "typesense_curation" "my_curation" {
name = "my-curation"
collection_name = typesense_collection.my_collection.name
rule {
query = "apple"
match = "exact"
}
include {
id = 4
}
include {
id = 10
position = 100
}
exclude = {
id = 100
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand Down Expand Up @@ -52,4 +78,10 @@ Required:
- **id** (String) Document id to include
- **position** (Number) Document position

## Import

Import is supported using the following syntax:

```shell
terraform import typesense_curation.my_curation my-curation
```
19 changes: 19 additions & 0 deletions docs/resources/synonyms.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,20 @@ description: |-

Search terms that should be considered equivalent

## Example Usage

```terraform
resource "typesense_synonyms" "my_synonyms" {
name = "my-synonyms"
collection_name = typesense_collection.my_collection.name
synonyms = [
"blazer",
"coat",
"jacket"
]
}
```

<!-- schema generated by tfplugindocs -->
## Schema
Expand All @@ -29,4 +42,10 @@ Search terms that should be considered equivalent
<a id="nestedblock--synonyms"></a>
### Nested Schema for `synonyms`

## Import

Import is supported using the following syntax:

```shell
terraform import typesense_synonyms.my_synonyms my_synonyms
```
3 changes: 3 additions & 0 deletions examples/data-sources/typesense_collection/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data "typesense_collection" "my_collection" {
name = "my-collection"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
data "typesense_collection_alias" "my_alias" {
name = "my-alias"
collection_name = "my-collection"
}
4 changes: 4 additions & 0 deletions examples/data-sources/typesense_curation/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
data "typesense_curation" "my_curation" {
name = "my-curation"
collection_name = "my-collection"
}
4 changes: 4 additions & 0 deletions examples/data-sources/typesense_synonyms/data-source.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
data "typesense_synonyms" "my_synonyms" {
name = "my-synonyms"
collection_name = "my-collection"
}
3 changes: 2 additions & 1 deletion examples/providers/provider.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
provider "typesense" {
api_key = "xxxxxxxxxxxxxxxxxx" // Or TYPESENSE_API_KEY enivoronment variable
api_key = "xxxxxxxxxxxxxxxxxx" // Or TYPESENSE_API_KEY enivoronment variable
api_address = "https://your.typesense.server" // Or TYPESENSE_APP_ADDRESS enivoronment variable
}
1 change: 1 addition & 0 deletions examples/resources/typesense_collection/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import typesense_collection.my_collection my-collection
8 changes: 8 additions & 0 deletions examples/resources/typesense_collection/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resource "typesense_collection" "my_collection" {
name = "my-collection"

fields {
name = "name"
type = "string"
}
}
1 change: 1 addition & 0 deletions examples/resources/typesense_collection_alias/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import typesense_collection_alias.my_alias my-alias
4 changes: 4 additions & 0 deletions examples/resources/typesense_collection_alias/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
resource "typesense_collection_alias" "my_alias" {
name = "my-alias"
collection_name = typesense_collection.my_collection.name
}
1 change: 1 addition & 0 deletions examples/resources/typesense_curation/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import typesense_curation.my_curation my-curation
23 changes: 23 additions & 0 deletions examples/resources/typesense_curation/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
resource "typesense_curation" "my_curation" {
name = "my-curation"
collection_name = typesense_collection.my_collection.name

rule {
query = "apple"
match = "exact"
}

include {
id = 4
}


include {
id = 10
position = 100
}

exclude = {
id = 100
}
}
1 change: 1 addition & 0 deletions examples/resources/typesense_synonyms/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import typesense_synonyms.my_synonyms my_synonyms
10 changes: 10 additions & 0 deletions examples/resources/typesense_synonyms/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
resource "typesense_synonyms" "my_synonyms" {
name = "my-synonyms"
collection_name = typesense_collection.my_collection.name

synonyms = [
"blazer",
"coat",
"jacket"
]
}

0 comments on commit b4bd5ac

Please sign in to comment.