### Setup API Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/rest-apis/setup-api/index.html Creates the .zentity-models index with specified shard and replica configurations. ```APIDOC ## POST /_zentity/_setup ### Description Creates the `.zentity-models` index. You can configure the number of primary shards and replica shards. ### Method POST ### Endpoint `/_zentity/_setup` ### Parameters #### Query Parameters - **number_of_shards** (Integer) - Optional - Define the number of primary shards for the index. Defaults to 1. - **number_of_replicas** (Integer) - Optional - Define the number of replica shards for the index. Defaults to 1. ### Request Example ```json { "number_of_shards": 2, "number_of_replicas": 1 } ``` ### Response #### Success Response (200) (No specific response body details provided in the documentation) #### Response Example (No example provided in the documentation) ``` -------------------------------- ### Invoke zentity Setup API (Elasticsearch) Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/installation/index.html Optionally invokes the zentity Setup API to create the .zentity-models index. This index is automatically created if it doesn't exist upon invoking the Models API. ```http POST http://localhost:9200/_zentity/_setup ``` -------------------------------- ### Verify zentity Installation (Elasticsearch) Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/installation/index.html Checks if zentity is installed and running by sending a GET request to the _zentity endpoint on localhost:9200. Expects a JSON response with zentity details. ```http GET http://localhost:9200/_zentity ``` -------------------------------- ### Setup API Permissions Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/security/index.html Required index privileges and actions granted for the Zentity Setup API. ```APIDOC ## Setup API Permissions ### Description These permission settings apply to the [Setup API](/docs/rest-apis/setup-api) and are necessary for initial Zentity configuration. ### Index Privileges - **Indices**: `.zentity-models` - **Permissions**: `create_index` ### Actions Granted - `POST _zentity/_setup` ``` -------------------------------- ### Resolvers Example Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/entity-models/specification/index.html Provides an example JSON configuration for setting up multiple resolvers. ```APIDOC ### Resolvers Example #### Request Body Example ```json { "resolvers": { "name_street_city_state": { "attributes": [ "name", "street", "city", "state" ] }, "name_street_zip": { "attributes": [ "name", "street", "zip" ] }, "name_phone": { "attributes": [ "name", "phone" ] }, "name_email": { "attributes": [ "name", "email" ] }, "email_phone": { "attributes": [ "email", "phone" ] }, "ssn": { "attributes": [ "ssn" ], "weight": 1 } } } ``` #### Response Example None (This is a configuration example) ``` -------------------------------- ### Install zentity Plugin from Local File (Elasticsearch) Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/installation/index.html Installs the zentity Elasticsearch plugin from a local zip file using the elasticsearch-plugin script. Requires Elasticsearch to be installed and the zip file to be accessible. ```bash elasticsearch-plugin install file:///path/to/zentity-1.8.3-elasticsearch-8.17.4.zip ``` -------------------------------- ### JSON Example of Matcher Configurations Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/entity-models/specification/index.html Provides concrete examples of different matcher types like exact, fuzzy, standard, and timestamp matchers. Each example shows the clause, parameters, and quality score. ```json { "matchers": { "exact_matcher": { "clause": { "term": { "{{ field }}": "{{ value }}" } } }, "fuzzy_matcher": { "clause":{ "match": { "{{ field }}": { "query": "{{ value }}", "fuzziness": "{{ params.fuzziness }}" } } }, "params": { "fuzziness": "auto" }, "quality": 0.95 }, "standard_matcher": { "clause": { "match": { "{{ field }}": "{{ value }}" } }, "quality": 0.98 }, "timestamp_matcher": { "clause": { "range": { "{{ field }}": { "gte": "{{ value }}||-{{ params.window }}", "lte": "{{ value }}||+{{ params.window }}", "format": "{{ params.format }}" } } }, "params": { "format": "yyyy-MM-dd'T'HH:mm:ss.SSS", "window": "15m" }, "quality": 0.92 } } } ``` -------------------------------- ### zentity Setup API Endpoint Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/rest-apis/setup-api/index.html This defines the REST API endpoint for setting up zentity models. It accepts POST requests to `_zentity/_setup` and supports URL parameters for configuring the number of shards and replicas. ```bash POST _zentity/_setup ``` -------------------------------- ### Install zentity Plugin from Remote URL (Elasticsearch) Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/installation/index.html Installs the zentity Elasticsearch plugin from a remote zip file using the elasticsearch-plugin script. Ensure Elasticsearch is installed and accessible. ```bash elasticsearch-plugin install https://zentity.io/releases/zentity-1.8.3-elasticsearch-8.17.4.zip ``` -------------------------------- ### Resolver Configuration Example Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/entity-models/specification/index.html Provides a practical JSON example of resolver configurations. This demonstrates how to group attributes like 'name', 'street', 'city', 'state', 'zip', 'ssn', 'phone', and 'email' to define different resolution strategies. ```json { "resolvers": { "name_street_city_state": { "attributes": [ "name", "street", "city", "state" ] }, "name_street_zip": { "attributes": [ "name", "street", "zip" ] }, "name_phone": { "attributes": [ "name", "phone" ] }, "name_email": { "attributes": [ "name", "email" ] }, "name_phone": { "attributes": [ "name", "phone" ] }, "email_phone": { "attributes": [ "email", "phone" ] }, "ssn": { "attributes": [ "ssn" ], "weight": 1 } } } ``` -------------------------------- ### Install Phonetic Analysis Plugin (Windows) Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/basic-usage/scoping-resolution/index.html Installs the Elasticsearch phonetic analysis plugin using the elasticsearch-plugin.bat command. Requires stopping Elasticsearch before execution and restarting it afterward. Assumes a .zip installation in the $ES_HOME directory. ```batch bin/elasticsearch-plugin.bat install analysis-phonetic ``` -------------------------------- ### Zentity Index Field Configuration Example Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/entity-models/specification/index.html An example illustrating how to configure multiple indices and their fields, specifying the corresponding attribute, matcher, and in some cases, a quality score for the matcher. ```json { "indices": { "users": { "fields": { "name": { "attribute": "name", "matcher": "fuzzy_matcher", "quality": 0.95 }, "zip.keyword": { "attribute": "zip", "matcher": "exact_matcher", "quality": 0.98 }, "email.keyword": { "attribute": "email", "matcher": "exact_matcher" } } }, "registrants": { "fields": { "full_name": { "attribute": "name", "matcher": "fuzzy_matcher", "quality": 0.98 }, "addr_street": { "attribute": "street", "matcher": "fuzzy_matcher", "quality": 0.95 }, "addr_city": { "attribute": "city", "matcher": "standard_matcher", "quality": 0.98 }, "addr_state_code.keyword": { "attribute": "state", "matcher": "exact_matcher" }, "addr_state_postal_code.keyword": { "attribute": "zip", "matcher": "exact_matcher" }, "email_address": { "attribute": "email", "matcher": "exact_matcher" }, "phone_number.keyword": { "attribute": "phone", "matcher": "exact_matcher" } } } } } ``` -------------------------------- ### Index Creation Error Example Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/security/index.html Example of an error response when attempting to create the .zentity-models index without sufficient permissions. ```APIDOC ## Index Creation Error Example ### Description This example shows the error received when trying to create the `.zentity-models` index automatically without the necessary `create_index` permission. ### Method POST (or other methods that might trigger index creation) ### Endpoint `_zentity/_setup` or `_zentity/models/{entity_type}` ### Response #### Success Response (403 Forbidden) - **error** (object) - Contains details about the security exception. - **root_cause** (array) - Array of root cause exceptions. - **type** (string) - Type of the security exception (e.g., "security_exception"). - **reason** (string) - Reason for the exception (e.g., "action [indices:admin/create] is unauthorized for user [USERNAME]"). - **type** (string) - Type of the security exception. - **reason** (string) - Reason for the exception. - **status** (integer) - HTTP status code (403). ### Response Example ```json { "error": { "root_cause": [ { "type": "security_exception", "reason": "action [indices:admin/create] is unauthorized for user [USERNAME]" } ], "type": "security_exception", "reason": "action [indices:admin/create] is unauthorized for user [USERNAME]" }, "status": 403 } ``` ``` -------------------------------- ### Zentity Multi-Resolver Resolution Example Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/basic-usage/multiple-resolver-resolution/index.html This example illustrates Zentity's multi-resolver resolution process, where data is matched against multiple resolvers. It details the attributes involved in the 'name_phone' resolver and lists various matches found with different input values and matching strategies. ```json { "resolvers" : { "name_phone" : { "attributes" : [ "first_name", "last_name", "phone" ] } }, "matches" : [ { "attribute" : "city", "target_field" : "city.clean", "target_value" : "Washington", "input_value" : "Washington", "input_matcher" : "fuzzy", "input_matcher_params" : { } }, { "attribute" : "first_name", "target_field" : "first_name.clean", "target_value" : "Alison", "input_value" : "Alison", "input_matcher" : "fuzzy", "input_matcher_params" : { } }, { "attribute" : "first_name", "target_field" : "first_name.clean", "target_value" : "Alison", "input_value" : "Allison", "input_matcher" : "fuzzy", "input_matcher_params" : { } }, { "attribute" : "first_name", "target_field" : "first_name.phonetic", "target_value" : "Alison", "input_value" : "Alison", "input_matcher" : "simple", "input_matcher_params" : { } }, { "attribute" : "first_name", "target_field" : "first_name.phonetic", "target_value" : "Alison", "input_value" : "Allison", "input_matcher" : "simple", "input_matcher_params" : { } }, { "attribute" : "last_name", "target_field" : "last_name.clean", "target_value" : "Smith", "input_value" : "Jones-Smith", "input_matcher" : "fuzzy", "input_matcher_params" : { } }, { "attribute" : "last_name", "target_field" : "last_name.phonetic", "target_value" : "Smith", "input_value" : "Jones-Smith", "input_matcher" : "simple", "input_matcher_params" : { } }, { "attribute" : "phone", "target_field" : "phone.clean", "target_value" : "202-555-9876", "input_value" : "2025559867", "input_matcher" : "fuzzy", "input_matcher_params" : { } }, { "attribute" : "state", "target_field" : "state.keyword", "target_value" : "DC", "input_value" : "DC", "input_matcher" : "exact", "input_matcher_params" : { } } ] ``` -------------------------------- ### Unauthorized User Response - Get Entity Model Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/security/index.html Example JSON response indicating a security exception when an unauthorized user attempts to retrieve an entity model from zentity. ```json { "error": { "root_cause": [ { "type": "security_exception", "reason": "action [indices:data/read/get] is unauthorized for user [USERNAME]" } ], "type": "security_exception", "reason": "action [indices:data/read/get] is unauthorized for user [USERNAME]" }, "status": 403 } ``` -------------------------------- ### Prepare for the tutorial Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/advanced-usage/date-attributes/index.html Steps to set up your environment for the Date Attributes tutorial, including Kibana Console access and index management. ```APIDOC ## Prepare for the tutorial ### 1.1 Open the Kibana Console UI The [Kibana Console UI](https://www.elastic.co/guide/en/kibana/current/console-kibana.html) makes it easy to submit requests to Elasticsearch and read responses. ### 1.2 Delete any old tutorial indices > **Note:** Skip this step if you're using the [zentity sandbox](/sandbox). Let's start from scratch. Delete any tutorial indices you might have created from other tutorials. #### Request Example ```json DELETE zentity_tutorial_8_* ``` ### 1.3 Create the tutorial index > **Note:** Skip this step if you're using the [zentity sandbox](/sandbox). Now create the index for this tutorial. #### Request Example ```json PUT zentity_tutorial_8_date_attributes { "settings": { "index": { "number_of_shards": 1, "number_of_replicas": 0 } }, "mappings": { "properties": { "@timestamp": { "type": "date" }, "id": { "type": "keyword" }, "ip": { "type": "keyword" }, "path": { "type": "keyword" } } } } ``` ``` -------------------------------- ### Load Tutorial Data Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/advanced-usage/matcher-parameters/index.html Adds tutorial data to the specified index. This is a bulk operation that allows for inserting multiple documents at once. ```APIDOC ## POST _bulk?refresh ### Description Adds tutorial data to the specified index using a bulk operation. ### Method POST ### Endpoint `/_bulk?refresh` ### Parameters #### Query Parameters - **refresh** (string) - Optional - Controls when the changes become visible. #### Request Body Each item in the body should be a JSON object representing an index operation and the document to be indexed. ```json { "index": { "_id": "string", "_index": "string" } } {"first_name": "string", "id": "string", "last_name": "string", "phone": "string"} ``` ### Request Example ```json [ { "index": { "_id": "1", "_index": "zentity_tutorial_7_matcher_parameters" } }, { "first_name": "Allie", "id": "1", "last_name": "Jones", "phone": "202-555-1234" }, { "index": { "_id": "2", "_index": "zentity_tutorial_7_matcher_parameters" } }, { "first_name": "Alicia", "id": "2", "last_name": "Johnson", "phone": "202-123-4567" } ] ``` ### Response #### Success Response (200) - **took** (integer) - The time in milliseconds the operation took. - **errors** (boolean) - Indicates if there were any errors during the bulk operation. - **items** (array) - An array of objects, each representing the result of an individual operation. - **index** (object) - Information about the index operation. - **_index** (string) - The name of the index. - **_id** (string) - The ID of the document. - **version** (integer) - The version of the document. - **result** (string) - The result of the operation (e.g., "created", "updated"). - **_shards** (object) - Information about shards. - **_seq_no** (integer) - Sequence number. - **_primary_term** (integer) - Primary term. #### Response Example ```json { "took": 15, "errors": false, "items": [ { "index": { "_index": "zentity_tutorial_7_matcher_parameters", "_id": "1", "version": 1, "result": "created", "_shards": { "total": 2, "successful": 1, "failed": 0 }, "_seq_no": 0, "_primary_term": 1 } }, { "index": { "_index": "zentity_tutorial_7_matcher_parameters", "_id": "2", "version": 1, "result": "created", "_shards": { "total": 2, "successful": 1, "failed": 0 }, "_seq_no": 1, "_primary_term": 1 } } ] } ``` ``` -------------------------------- ### Load Tutorial Data using Zentity IO Bulk API Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/basic-usage/multiple-resolver-resolution/index.html This snippet demonstrates how to add tutorial data to the Zentity index using the `_bulk` API. It requires a POST request with a list of index operations and JSON documents. Ensure the `refresh` query parameter is set if immediate indexing is needed. ```json POST /_bulk?refresh {"index": {"_id": "1", "_index": "zentity_tutorial_4_multiple_resolver_resolution"}} {"city": "Washington", "email": "allie@example.net", "first_name": "Allie", "id": "1", "last_name": "Jones", "phone": "202-555-1234", "state": "DC", "street": "123 Main St"} {"index": {"_id": "2", "_index": "zentity_tutorial_4_multiple_resolver_resolution"}} {"city": "Washington", "email": "", "first_name": "Alicia", "id": "2", "last_name": "Johnson", "phone": "202-123-4567", "state": "DC", "street": "300 Main St"} {"index": {"_id": "3", "_index": "zentity_tutorial_4_multiple_resolver_resolution"}} {"city": "Washington", "email": "", "first_name": "Allie", "id": "3", "last_name": "Jones", "phone": "", "state": "DC", "street": "123 Main St"} {"index": {"_id": "4", "_index": "zentity_tutorial_4_multiple_resolver_resolution"}} {"city": "", "email": "", "first_name": "Ally", "id": "4", "last_name": "Joans", "phone": "202-555-1234", "state": "", "street": ""} {"index": {"_id": "5", "_index": "zentity_tutorial_4_multiple_resolver_resolution"}} {"city": "Arlington", "email": "ej@example.net", "first_name": "Eli", "id": "5", "last_name": "Jonas", "phone": "", "state": "VA", "street": "500 23rd Street"} {"index": {"_id": "6", "_index": "zentity_tutorial_4_multiple_resolver_resolution"}} {"city": "Washington", "email": "allie@example.net", "first_name": "Allison", "id": "6", "last_name": "Jones", "phone": "202-555-1234", "state": "DC", "street": "123 Main St"} {"index": {"_id": "7", "_index": "zentity_tutorial_4_multiple_resolver_resolution"}} {"city": "Washington", "email": "", "first_name": "Allison", "id": "7", "last_name": "Smith", "phone": "+1 (202) 555 1234", "state": "DC", "street": "555 Broad St"} {"index": {"_id": "8", "_index": "zentity_tutorial_4_multiple_resolver_resolution"}} {"city": "Washington", "email": "alan.smith@example.net", "first_name": "Alan", "id": "8", "last_name": "Smith", "phone": "202-000-5555", "state": "DC", "street": "555 Broad St"} {"index": {"_id": "9", "_index": "zentity_tutorial_4_multiple_resolver_resolution"}} {"city": "Washington", "email": "alan.smith@example.net", "first_name": "Alan", "id": "9", "last_name": "Smith", "phone": "2020005555", "state": "DC", "street": "555 Broad St"} {"index": {"_id": "10", "_index": "zentity_tutorial_4_multiple_resolver_resolution"}} {"city": "Washington", "email": "", "first_name": "Alison", "id": "10", "last_name": "Smith", "phone": "202-555-9876", "state": "DC", "street": "555 Broad St"} {"index": {"_id": "11", "_index": "zentity_tutorial_4_multiple_resolver_resolution"}} {"city": "", "email": "allie@example.net", "first_name": "Alison", "id": "11", "last_name": "Jones-Smith", "phone": "2025559867", "state": "", "street": ""} {"index": {"_id": "12", "_index": "zentity_tutorial_4_multiple_resolver_resolution"}} {"city": "Washington", "email": "allison.j.smith@corp.example.net", "first_name": "Allison", "id": "12", "last_name": "Jones-Smith", "phone": "", "state": "DC", "street": "555 Broad St"} {"index": {"_id": "13", "_index": "zentity_tutorial_4_multiple_resolver_resolution"}} {"city": "Arlington", "email": "allison.j.smith@corp.example.net", "first_name": "Allison", "id": "13", "last_name": "Jones Smith", "phone": "703-555-5555", "state": "VA", "street": "1 Corporate Way"} {"index": {"_id": "14", "_index": "zentity_tutorial_4_multiple_resolver_resolution"}} {"city": "Arlington", "email": "elise.jonas@corp.example.net", "first_name": "Elise", "id": "14", "last_name": "Jonas", "phone": "703-555-5555", "state": "VA", "street": "1 Corporate Way"} ``` -------------------------------- ### Install ICU Analysis Plugin (Windows) Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/basic-usage/scoping-resolution/index.html Installs the Elasticsearch ICU analysis plugin using the elasticsearch-plugin.bat command. Requires stopping Elasticsearch before execution and restarting it afterward. Assumes a .zip installation in the $ES_HOME directory. ```batch bin/elasticsearch-plugin.bat install analysis-icu ``` -------------------------------- ### PUT /zentity_tutorial_4_multiple_resolver_resolution Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/basic-usage/multiple-resolver-resolution/index.html Creates the index template for the tutorial, including settings for analysis and mappings for various fields. ```APIDOC ## PUT /zentity_tutorial_4_multiple_resolver_resolution ### Description This endpoint creates the index template for the tutorial "Multiple Resolver Resolution". It defines index settings for analysis (tokenizers, filters, analyzers) and mappings for fields like id, first_name, last_name, street, city, state, phone, and email, including custom analyzers for cleaning and phonetic encoding. ### Method PUT ### Endpoint /zentity_tutorial_4_multiple_resolver_resolution ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **settings** (object) - Required - Configuration for the index, including analysis. - **index** (object) - Required - Index-specific settings. - **number_of_shards** (integer) - Required - Number of primary shards. - **number_of_replicas** (integer) - Required - Number of replica shards. - **analysis** (object) - Required - Defines custom analyzers and filters. - **filter** (object) - Defines text analysis filters. - **street_suffix_map** (object) - Pattern replace filter for street suffixes. - **phonetic** (object) - Phonetic encoding filter (nysiis). - **punct_white** (object) - Pattern replace filter for punctuation and whitespace. - **remove_non_digits** (object) - Pattern replace filter to remove non-digit characters. - **analyzer** (object) - Defines text analyzers. - **name_clean** (object) - Analyzer for cleaning names. - **name_phonetic** (object) - Analyzer for phonetic encoding of names. - **street_clean** (object) - Analyzer for cleaning street names. - **phone_clean** (object) - Analyzer for cleaning phone numbers. - **mappings** (object) - Required - Defines the schema for documents in the index. - **properties** (object) - Defines the fields within a document. - **id** (object) - Field for the unique identifier. - **type** (string) - Type of the field (keyword). - **first_name** (object) - Field for the first name. - **type** (string) - Type of the field (text). - **fields** (object) - Allows for multiple indexing options for the field. - **clean** (object) - Field indexed with the 'name_clean' analyzer. - **phonetic** (object) - Field indexed with the 'name_phonetic' analyzer. - **last_name** (object) - Field for the last name. - **type** (string) - Type of the field (text). - **fields** (object) - Allows for multiple indexing options for the field. - **clean** (object) - Field indexed with the 'name_clean' analyzer. - **phonetic** (object) - Field indexed with the 'name_phonetic' analyzer. - **street** (object) - Field for the street address. - **type** (string) - Type of the field (text). - **fields** (object) - Allows for multiple indexing options for the field. - **clean** (object) - Field indexed with the 'street_clean' analyzer. - **city** (object) - Field for the city. - **type** (string) - Type of the field (text). - **fields** (object) - Allows for multiple indexing options for the field. - **clean** (object) - Field indexed with the 'name_clean' analyzer. - **state** (object) - Field for the state. - **type** (string) - Type of the field (text). - **fields** (object) - Allows for multiple indexing options for the field. - **keyword** (object) - Field indexed as a keyword. - **phone** (object) - Field for the phone number. - **type** (string) - Type of the field (text). - **fields** (object) - Allows for multiple indexing options for the field. - **clean** (object) - Field indexed with the 'phone_clean' analyzer. - **email** (object) - Field for the email address. - **type** (string) - Type of the field (text). - **fields** (object) - Allows for multiple indexing options for the field. - **keyword** (object) - Field indexed as a keyword. ### Request Example ```json { "settings": { "index": { "number_of_shards": 1, "number_of_replicas": 0, "analysis" : { "filter" : { "street_suffix_map" : { "pattern" : "(st)", "type" : "pattern_replace", "replacement" : "street" }, "phonetic" : { "type" : "phonetic", "encoder" : "nysiis" }, "punct_white" : { "pattern" : "\\p{Punct}", "type" : "pattern_replace", "replacement" : " " }, "remove_non_digits" : { "pattern" : "[^'\\d']", "type" : "pattern_replace", "replacement" : "" } }, "analyzer" : { "name_clean" : { "filter" : [ "icu_normalizer", "icu_folding", "punct_white" ], "tokenizer" : "standard" }, "name_phonetic" : { "filter" : [ "icu_normalizer", "icu_folding", "punct_white", "phonetic" ], "tokenizer" : "standard" }, "street_clean" : { "filter" : [ "icu_normalizer", "icu_folding", "punct_white", "trim" ], "tokenizer" : "keyword" }, "phone_clean" : { "filter" : [ "remove_non_digits" ], "tokenizer" : "keyword" } } } } }, "mappings": { "properties": { "id": { "type": "keyword" }, "first_name": { "type": "text", "fields": { "clean": { "type": "text", "analyzer": "name_clean" }, "phonetic": { "type": "text", "analyzer": "name_phonetic" } } }, "last_name": { "type": "text", "fields": { "clean": { "type": "text", "analyzer": "name_clean" }, "phonetic": { "type": "text", "analyzer": "name_phonetic" } } }, "street": { "type": "text", "fields": { "clean": { "type": "text", "analyzer": "street_clean" } } }, "city": { "type": "text", "fields": { "clean": { "type": "text", "analyzer": "name_clean" } } }, "state": { "type": "text", "fields": { "keyword": { "type": "keyword" } } }, "phone": { "type": "text", "fields": { "clean": { "type": "text", "analyzer": "phone_clean" } } }, "email": { "type": "text", "fields": { "keyword": { "type": "keyword" } } } } } } ``` ### Response #### Success Response (200) - **acknowledged** (boolean) - Indicates if the index creation was acknowledged. #### Response Example ```json { "acknowledged": true } ``` ``` -------------------------------- ### Install ICU Analysis Plugin (Linux) Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/basic-usage/scoping-resolution/index.html Installs the Elasticsearch ICU analysis plugin using the elasticsearch-plugin command. Requires stopping Elasticsearch before execution and restarting it afterward. Assumes a .tar.gz installation in the $ES_HOME directory. ```bash sudo bin/elasticsearch-plugin install analysis-icu ``` -------------------------------- ### Load Tutorial Data using Zentity Bulk API Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/basic-usage/scoping-resolution/index.html This snippet demonstrates how to load tutorial data into Zentity using the `_bulk` API endpoint. It includes multiple document entries with specified index and document IDs. This is crucial for setting up the data required for cross-index resolution examples. ```json POST _bulk?refresh {"index": {"_id": "1", "_index": "zentity_tutorial_5_cross_index_resolution_a"}} {"city_a": "Washington", "email_a": "allie@example.net", "first_name_a": "Allie", "id_a": "1", "last_name_a": "Jones", "phone_a": "202-555-1234", "state_a": "DC", "street_a": "123 Main St"} {"index": {"_id": "2", "_index": "zentity_tutorial_5_cross_index_resolution_b"}} {"city_b": "Washington", "email_b": "", "first_name_b": "Alicia", "id_b": "2", "last_name_b": "Johnson", "phone_b": "202-123-4567", "state_b": "DC", "street_b": "300 Main St"} {"index": {"_id": "3", "_index": "zentity_tutorial_5_cross_index_resolution_a"}} {"city_a": "Washington", "email_a": "", "first_name_a": "Allie", "id_a": "3", "last_name_a": "Jones", "phone_a": "", "state_a": "DC", "street_a": "123 Main St"} {"index": {"_id": "4", "_index": "zentity_tutorial_5_cross_index_resolution_b"}} {"city_b": "", "email_b": "", "first_name_b": "Ally", "id_b": "4", "last_name_b": "Joans", "phone_b": "202-555-1234", "state_b": "", "street_b": ""} {"index": {"_id": "5", "_index": "zentity_tutorial_5_cross_index_resolution_a"}} {"city_a": "Arlington", "email_a": "ej@example.net", "first_name_a": "Eli", "id_a": "5", "last_name_a": "Jonas", "phone_a": "", "state_a": "VA", "street_a": "500 23rd Street"} {"index": {"_id": "6", "_index": "zentity_tutorial_5_cross_index_resolution_b"}} {"city_b": "Washington", "email_b": "allie@example.net", "first_name_b": "Allison", "id_b": "6", "last_name_b": "Jones", "phone_b": "202-555-1234", "state_b": "DC", "street_b": "123 Main St"} {"index": {"_id": "7", "_index": "zentity_tutorial_5_cross_index_resolution_a"}} {"city_a": "Washington", "email_a": "", "first_name_a": "Allison", "id_a": "7", "last_name_a": "Smith", "phone_a": "+1 (202) 555 1234", "state_a": "DC", "street_a": "555 Broad St"} {"index": {"_id": "8", "_index": "zentity_tutorial_5_cross_index_resolution_b"}} {"city_b": "Washington", "email_b": "alan.smith@example.net", "first_name_b": "Alan", "id_b": "8", "last_name_b": "Smith", "phone_b": "202-000-5555", "state_b": "DC", "street_b": "555 Broad St"} {"index": {"_id": "9", "_index": "zentity_tutorial_5_cross_index_resolution_a"}} {"city_a": "Washington", "email_a": "alan.smith@example.net", "first_name_a": "Alan", "id_a": "9", "last_name_a": "Smith", "phone_a": "2020005555", "state_a": "DC", "street_a": "555 Broad St"} {"index": {"_id": "10", "_index": "zentity_tutorial_5_cross_index_resolution_b"}} {"city_b": "Washington", "email_b": "", "first_name_b": "Alison", "id_b": "10", "last_name_b": "Smith", "phone_b": "202-555-9876", "state_b": "DC", "street_b": "555 Broad St"} {"index": {"_id": "11", "_index": "zentity_tutorial_5_cross_index_resolution_a"}} {"city_a": "", "email_a": "allie@example.net", "first_name_a": "Alison", "id_a": "11", "last_name_a": "Jones-Smith", "phone_a": "2025559867", "state_a": "", "street_a": ""} {"index": {"_id": "12", "_index": "zentity_tutorial_5_cross_index_resolution_b"}} {"city_b": "Washington", "email_b": "allison.j.smith@corp.example.net", "first_name_b": "Allison", "id_b": "12", "last_name_b": "Jones-Smith", "phone_b": "", "state_b": "DC", "street_b": "555 Broad St"} {"index": {"_id": "13", "_index": "zentity_tutorial_5_cross_index_resolution_a"}} {"city_a": "Arlington", "email_a": "allison.j.smith@corp.example.net", "first_name_a": "Allison", "id_a": "13", "last_name_a": "Jones Smith", "phone_a": "703-555-5555", "state_a": "VA", "street_a": "1 Corporate Way"} {"index": {"_id": "14", "_index": "zentity_tutorial_5_cross_index_resolution_b"}} {"city_b": "Arlington", "email_b": "elise.jonas@corp.example.net", "first_name_b": "Elise", "id_b": "14", "last_name_b": "Jonas", "phone_b": "703-555-5555", "state_b": "VA", "street_b": "1 Corporate Way"} ``` -------------------------------- ### Install Phonetic Analysis Plugin (Linux) Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/basic-usage/scoping-resolution/index.html Installs the Elasticsearch phonetic analysis plugin using the elasticsearch-plugin command. Requires stopping Elasticsearch before execution and restarting it afterward. Assumes a .tar.gz installation in the $ES_HOME directory. ```bash sudo bin/elasticsearch-plugin install analysis-phonetic ``` -------------------------------- ### Load Tutorial Data using Elasticsearch _bulk API Source: https://github.com/zentity-io/zentity-io.github.io/blob/main/docs/basic-usage/exact-name-matching/index.html This snippet demonstrates how to add tutorial data to an Elasticsearch index using the _bulk API. It requires the Elasticsearch client or a tool capable of making HTTP requests. The input is a series of JSON documents, each preceded by an index operation. ```json POST _bulk?refresh {"index": {"_id": "1", "_index": "zentity_tutorial_1_exact_name_matching"}} {"city": "Washington", "email": "allie@example.net", "first_name": "Allie", "id": "1", "last_name": "Jones", "phone": "202-555-1234", "state": "DC", "street": "123 Main St"} {"index": {"_id": "2", "_index": "zentity_tutorial_1_exact_name_matching"}} {"city": "Washington", "email": "", "first_name": "Alicia", "id": "2", "last_name": "Johnson", "phone": "202-123-4567", "state": "DC", "street": "300 Main St"} {"index": {"_id": "3", "_index": "zentity_tutorial_1_exact_name_matching"}} {"city": "Washington", "email": "", "first_name": "Allie", "id": "3", "last_name": "Jones", "phone": "", "state": "DC", "street": "123 Main St"} {"index": {"_id": "4", "_index": "zentity_tutorial_1_exact_name_matching"}} {"city": "", "email": "", "first_name": "Ally", "id": "4", "last_name": "Joans", "phone": "202-555-1234", "state": "", "street": ""} {"index": {"_id": "5", "_index": "zentity_tutorial_1_exact_name_matching"}} {"city": "Arlington", "email": "ej@example.net", "first_name": "Eli", "id": "5", "last_name": "Jonas", "phone": "", "state": "VA", "street": "500 23rd Street"} {"index": {"_id": "6", "_index": "zentity_tutorial_1_exact_name_matching"}} {"city": "Washington", "email": "allie@example.net", "first_name": "Allison", "id": "6", "last_name": "Jones", "phone": "202-555-1234", "state": "DC", "street": "123 Main St"} {"index": {"_id": "7", "_index": "zentity_tutorial_1_exact_name_matching"}} {"city": "Washington", "email": "", "first_name": "Allison", "id": "7", "last_name": "Smith", "phone": "+1 (202) 555 1234", "state": "DC", "street": "555 Broad St"} {"index": {"_id": "8", "_index": "zentity_tutorial_1_exact_name_matching"}} {"city": "Washington", "email": "alan.smith@example.net", "first_name": "Alan", "id": "8", "last_name": "Smith", "phone": "202-000-5555", "state": "DC", "street": "555 Broad St"} {"index": {"_id": "9", "_index": "zentity_tutorial_1_exact_name_matching"}} {"city": "Washington", "email": "alan.smith@example.net", "first_name": "Alan", "id": "9", "last_name": "Smith", "phone": "2020005555", "state": "DC", "street": "555 Broad St"} {"index": {"_id": "10", "_index": "zentity_tutorial_1_exact_name_matching"}} {"city": "Washington", "email": "", "first_name": "Alison", "id": "10", "last_name": "Smith", "phone": "202-555-9876", "state": "DC", "street": "555 Broad St"} {"index": {"_id": "11", "_index": "zentity_tutorial_1_exact_name_matching"}} {"city": "", "email": "allie@example.net", "first_name": "Alison", "id": "11", "last_name": "Jones-Smith", "phone": "2025559867", "state": "", "street": ""} {"index": {"_id": "12", "_index": "zentity_tutorial_1_exact_name_matching"}} {"city": "Washington", "email": "allison.j.smith@corp.example.net", "first_name": "Allison", "id": "12", "last_name": "Jones-Smith", "phone": "", "state": "DC", "street": "555 Broad St"} {"index": {"_id": "13", "_index": "zentity_tutorial_1_exact_name_matching"}} {"city": "Arlington", "email": "allison.j.smith@corp.example.net", "first_name": "Allison", "id": "13", "last_name": "Jones Smith", "phone": "703-555-5555", "state": "VA", "street": "1 Corporate Way"} {"index": {"_id": "14", "_index": "zentity_tutorial_1_exact_name_matching"}} {"city": "Arlington", "email": "elise.jonas@corp.example.net", "first_name": "Elise", "id": "14", "last_name": "Jonas", "phone": "703-555-5555", "state": "VA", "street": "1 Corporate Way"} ```