<commit_before>module AgnosticBackend
  module Elasticsearch
    class Index < AgnosticBackend::Index

      attr_reader :index_name,
                  :type,
                  :endpoint,
                  :enable_all
      # TODO: add authentication of some sort

      def initialize(indexable_klass, **options)
        super(indexable_klass)
        @index_name = parse_option(options, :index_name)
        @type = parse_option(options, :type)
        @endpoint = parse_option(options, :endpoint)
        @enable_all = parse_option(options, :enable_all, optional: true, default: false)
      end

      def indexer
        AgnosticBackend::Elasticsearch::Indexer.new(self)
      end

      def query_builder
        AgnosticBackend::Queryable::Elasticsearch::QueryBuilder.new(self)
      end

      def schema
        @schema ||= @indexable_klass.schema { |ftype| ftype }
      end

      def client
        @client ||= AgnosticBackend::Elasticsearch::Client.new(endpoint: endpoint)
      end<commit_msg>Removes obsolete comment<commit_after>module AgnosticBackend
  module Elasticsearch
    class Index < AgnosticBackend::Index

      attr_reader :index_name,
                  :type,
                  :endpoint,
                  :enable_all

      def initialize(indexable_klass, **options)
        super(indexable_klass)
        @index_name = parse_option(options, :index_name)
        @type = parse_option(options, :type)
        @endpoint = parse_option(options, :endpoint)
        @enable_all = parse_option(options, :enable_all, optional: true, default: false)
      end

      def indexer
        AgnosticBackend::Elasticsearch::Indexer.new(self)
      end

      def query_builder
        AgnosticBackend::Queryable::Elasticsearch::QueryBuilder.new(self)
      end

      def schema
        @schema ||= @indexable_klass.schema { |ftype| ftype }
      end

      def client
        @client ||= AgnosticBackend::Elasticsearch::Client.new(endpoint: endpoint)
      end
{'fraction_non_alphanumeric': 0.08792319353208691, 'fraction_numerical': 0.0, 'mean_word_length': 2.5611510791366907, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5515778', 'n_tokens_mistral': 559, 'n_tokens_neox': 563, 'n_words': 115}