Skip to content

Commit

Permalink
Added analyzer documentation (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
LaravelFreelancerNL authored Dec 19, 2023
1 parent 7a31444 commit 3b19d62
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ $client->transactions()->begin(['write' => ['users', 'teams']]);
2) [User schema](docs/schema-users.md)
3) [Collection schema](docs/schema-collections.md)
4) [Index schema](docs/schema-indexes.md)
5) [View schema](docs/schema-views.md)
6) [Graph schema](docs/schema-graphs.md)
5) [Graph schema](docs/schema-graphs.md)
6) [View schema](docs/schema-views.md)
7) [Analyzer schema](docs/schema-analyzers.md)
5) [Transaction manager](docs/transaction-manager.md)

## Related packages
Expand Down
43 changes: 43 additions & 0 deletions docs/schema-analyzers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Schema manager - Analyzers
You can use the schema manager to perform CRUD actions on ArangoDB analyzers.

## Analyzer functions
The schema manager supports the following analyzer functions:

### createAnalyzer(array $analyzer): stdClass
```
$arangoClient->schema()->createAnalyzer([
'name' => 'myAnalyzer',
'type' => 'identity',
]);
```

### getAnalyzer(string $name): stdClass
```
$arangoClient->schema()->getAnalyzer('myAnalyzer');
```

### getAnalyzers(): array
```
$arangoClient->schema()->getAnalyzers();
```

### hasAnalyzer(string $name): bool
```
$arangoClient->schema()->hasAnalyzer('myAnalyzer');
```

### replaceAnalyzer(string $name, array $newAnalyzer): stdClass|false
This will delete the old analyzer and create a new one under the same name.
```
$arangoClient->schema()->replaceAnalyzer('myAnalyzer', [
'name' => 'myAnalyzer',
'type' => 'identity',
]);
```

### deleteAnalyzer(string $name): bool
```
$arangoClient->schema()->deleteAnalyzer('myAnalyzer');
```

2 changes: 1 addition & 1 deletion docs/schema-views.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
You can use the schema manager to perform CRUD actions on ArangoSearch views.

## View functions
The schema manager supports the following index functions:
The schema manager supports the following view functions:

### createView(array $view): stdClass
```
Expand Down
2 changes: 1 addition & 1 deletion src/Statement/Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Statement extends Manager implements IteratorAggregate
/**
* Statement constructor.
*
* @param ?array<mixed> $bindVars
* @param array<mixed>|null $bindVars
* @param array<mixed> $options
*/
public function __construct(protected ArangoClient $arangoClient, protected string $query, protected ?array $bindVars, protected array $options = []) {}
Expand Down

0 comments on commit 3b19d62

Please sign in to comment.