Class TurElasticsearchUtils

java.lang.Object
com.viglet.turing.elasticsearch.TurElasticsearchUtils

public class TurElasticsearchUtils extends Object
Static utility methods for Elasticsearch index management. Mirrors TurLuceneUtils for the Elasticsearch engine.
Since:
2026.1
Author:
Alexandre Oliveira
  • Method Details

    • createIndex

      public static void createIndex(String endpointUrl, String indexName)
      Creates an Elasticsearch index if it does not already exist.
      Parameters:
      endpointUrl - the Elasticsearch endpoint URL
      indexName - the name of the index to create
    • createIndex

      public static void createIndex(String endpointUrl, String indexName, Map<String, TurSEFieldType> fieldTypes)
      Creates an Elasticsearch index with explicit field type mappings. STRING/ARRAY → keyword, TEXT → text+keyword sub-field, BOOL → boolean, INT → integer, LONG/DATE → long/date, FLOAT → float, DOUBLE/CURRENCY → double.
      Parameters:
      endpointUrl - the Elasticsearch endpoint URL
      indexName - the name of the index to create
      fieldTypes - map of field name → Turing field type
    • deleteIndex

      public static void deleteIndex(String endpointUrl, String indexName)
      Deletes an Elasticsearch index if it exists.
      Parameters:
      endpointUrl - the Elasticsearch endpoint URL
      indexName - the name of the index to delete