All URIs are relative to https://api.search.io.
Method | HTTP request | Description |
---|---|---|
batchCreateSchemaFields() | POST /v4/collections/{collection_id}/schemaFields:batchCreate | Batch create schema fields |
createSchemaField() | POST /v4/collections/{collection_id}/schemaFields | Create schema field |
deleteSchemaField() | DELETE /v4/collections/{collection_id}/schemaFields/{schema_field_name} | Delete schema field |
listSchemaFields() | GET /v4/collections/{collection_id}/schemaFields | List schema fields |
updateSchemaField() | PATCH /v4/collections/{collection_id}/schemaFields/{schema_field_name} | Update schema field |
batchCreateSchemaFields($collection_id, $batch_create_schema_fields_request): \Sajari\Model\BatchCreateSchemaFieldsResponse
Batch create schema fields
The batch version of the CreateSchemaField call.
<?php
require_once __DIR__ . "/vendor/autoload.php";
// Configure HTTP basic authorization: BasicAuth
$config = Sajari\Configuration::getDefaultConfiguration()
->setUsername("YOUR_USERNAME")
->setPassword("YOUR_PASSWORD");
$apiInstance = new Sajari\Api\SchemaApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$collection_id = "collection_id_example"; // string | The collection to create the schema fields in, e.g. `my-collection`.
$batch_create_schema_fields_request = new \Sajari\Model\BatchCreateSchemaFieldsRequest(); // \Sajari\Model\BatchCreateSchemaFieldsRequest
try {
$result = $apiInstance->batchCreateSchemaFields(
$collection_id,
$batch_create_schema_fields_request
);
print_r($result);
} catch (Exception $e) {
echo "Exception when calling SchemaApi->batchCreateSchemaFields: ",
$e->getMessage(),
PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
collection_id | string | The collection to create the schema fields in, e.g. `my-collection`. | |
batch_create_schema_fields_request | \Sajari\Model\BatchCreateSchemaFieldsRequest |
\Sajari\Model\BatchCreateSchemaFieldsResponse
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
createSchemaField($collection_id, $schema_field): \Sajari\Model\SchemaField
Create schema field
Create a new field in a collection's schema.
<?php
require_once __DIR__ . "/vendor/autoload.php";
// Configure HTTP basic authorization: BasicAuth
$config = Sajari\Configuration::getDefaultConfiguration()
->setUsername("YOUR_USERNAME")
->setPassword("YOUR_PASSWORD");
$apiInstance = new Sajari\Api\SchemaApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$collection_id = "collection_id_example"; // string | The collection to create a schema field in, e.g. `my-collection`.
$schema_field = new \Sajari\Model\SchemaField(); // \Sajari\Model\SchemaField | The schema field to create.
try {
$result = $apiInstance->createSchemaField($collection_id, $schema_field);
print_r($result);
} catch (Exception $e) {
echo "Exception when calling SchemaApi->createSchemaField: ",
$e->getMessage(),
PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
collection_id | string | The collection to create a schema field in, e.g. `my-collection`. | |
schema_field | \Sajari\Model\SchemaField | The schema field to create. |
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteSchemaField($collection_id, $schema_field_name): mixed
Delete schema field
Deleting a schema field removes it from all records within the collection, however, references to the schema field in pipelines are not removed. > Note: This operation cannot be reversed.
<?php
require_once __DIR__ . "/vendor/autoload.php";
// Configure HTTP basic authorization: BasicAuth
$config = Sajari\Configuration::getDefaultConfiguration()
->setUsername("YOUR_USERNAME")
->setPassword("YOUR_PASSWORD");
$apiInstance = new Sajari\Api\SchemaApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$collection_id = "collection_id_example"; // string | The collection the schema field belongs to, e.g. `my-collection`.
$schema_field_name = "schema_field_name_example"; // string | The name of the schema field to delete.
try {
$result = $apiInstance->deleteSchemaField($collection_id, $schema_field_name);
print_r($result);
} catch (Exception $e) {
echo "Exception when calling SchemaApi->deleteSchemaField: ",
$e->getMessage(),
PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
collection_id | string | The collection the schema field belongs to, e.g. `my-collection`. | |
schema_field_name | string | The name of the schema field to delete. |
mixed
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
listSchemaFields($collection_id, $page_size, $page_token): \Sajari\Model\ListSchemaFieldsResponse
List schema fields
Retrieve a list of schema fields in a collection.
<?php
require_once __DIR__ . "/vendor/autoload.php";
// Configure HTTP basic authorization: BasicAuth
$config = Sajari\Configuration::getDefaultConfiguration()
->setUsername("YOUR_USERNAME")
->setPassword("YOUR_PASSWORD");
$apiInstance = new Sajari\Api\SchemaApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$collection_id = "collection_id_example"; // string | The collection that owns this set of schema fields, e.g. `my-collection`.
$page_size = 56; // int | The maximum number of schema fields to return. The service may return fewer than this value. If unspecified, at most 50 schema fields are returned. The maximum value is 1000; values above 1000 are coerced to 1000.
$page_token = "page_token_example"; // string | A page token, received from a previous [ListSchemaFields](/docs/api#operation/ListSchemaFields) call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to [ListSchemaFields](/docs/api#operation/ListSchemaFields) must match the call that provided the page token.
try {
$result = $apiInstance->listSchemaFields(
$collection_id,
$page_size,
$page_token
);
print_r($result);
} catch (Exception $e) {
echo "Exception when calling SchemaApi->listSchemaFields: ",
$e->getMessage(),
PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
collection_id | string | The collection that owns this set of schema fields, e.g. `my-collection`. | |
page_size | int | The maximum number of schema fields to return. The service may return fewer than this value. If unspecified, at most 50 schema fields are returned. The maximum value is 1000; values above 1000 are coerced to 1000. | [optional] |
page_token | string | A page token, received from a previous ListSchemaFields call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListSchemaFields must match the call that provided the page token. | [optional] |
\Sajari\Model\ListSchemaFieldsResponse
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
updateSchemaField($collection_id, $schema_field_name, $schema_field, $update_mask): \Sajari\Model\SchemaField
Update schema field
Update the details of a schema field. Only name
and description
can be updated.
<?php
require_once __DIR__ . "/vendor/autoload.php";
// Configure HTTP basic authorization: BasicAuth
$config = Sajari\Configuration::getDefaultConfiguration()
->setUsername("YOUR_USERNAME")
->setPassword("YOUR_PASSWORD");
$apiInstance = new Sajari\Api\SchemaApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$collection_id = "collection_id_example"; // string | The collection the schema field belongs to, e.g. `my-collection`.
$schema_field_name = "schema_field_name_example"; // string | The name of the schema field to update.
$schema_field = new \Sajari\Model\SchemaField(); // \Sajari\Model\SchemaField | The schema field details to update.
$update_mask = "update_mask_example"; // string | The list of fields to update, separated by a comma, e.g. `name,description`. Each field should be in snake case. For each field that you want to update, provide a corresponding value in the schema field object containing the new value.
try {
$result = $apiInstance->updateSchemaField(
$collection_id,
$schema_field_name,
$schema_field,
$update_mask
);
print_r($result);
} catch (Exception $e) {
echo "Exception when calling SchemaApi->updateSchemaField: ",
$e->getMessage(),
PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
collection_id | string | The collection the schema field belongs to, e.g. `my-collection`. | |
schema_field_name | string | The name of the schema field to update. | |
schema_field | \Sajari\Model\SchemaField | The schema field details to update. | |
update_mask | string | The list of fields to update, separated by a comma, e.g. `name,description`. Each field should be in snake case. For each field that you want to update, provide a corresponding value in the schema field object containing the new value. | [optional] |
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]