<commit_before>package main

import (
	"time"
	"unicode/utf8"

	"github.com/256dpi/fire"
	"github.com/256dpi/fire/coal"
	"github.com/256dpi/fire/flame"

	"github.com/globalsign/mgo/bson"
)

var catalog = coal.NewCatalog(&Item{})

var indexer = coal.NewIndexer()

func init() {
	// add flame indexes
	flame.AddApplicationIndexes(indexer)
	flame.AddUserIndexes(indexer)
	flame.AddAccessTokenIndexes(indexer, true)
	flame.AddRefreshTokenIndexes(indexer, true)

	// add item index
	indexer.Add(&Item{}, false, 0, "Name")

	// add background delete index
	indexer.Add(&Item{}, false, time.Second, "Deleted")
}

// EnsureIndexes will ensure that the required indexes exist.
func EnsureIndexes(store *coal.Store) error {
	// ensure model indexes
	err := indexer.Ensure(store)
	if err != nil {
		return err
	}

	return nil
}<commit_msg>added axe indexes<commit_after>package main

import (
	"time"
	"unicode/utf8"

	"github.com/256dpi/fire"
	"github.com/256dpi/fire/axe"
	"github.com/256dpi/fire/coal"
	"github.com/256dpi/fire/flame"

	"github.com/globalsign/mgo/bson"
)

var catalog = coal.NewCatalog(&Item{})

var indexer = coal.NewIndexer()

func init() {
	// add flame indexes
	flame.AddApplicationIndexes(indexer)
	flame.AddUserIndexes(indexer)
	flame.AddAccessTokenIndexes(indexer, true)
	flame.AddRefreshTokenIndexes(indexer, true)

	// add axe indexes
	axe.AddJobIndexes(indexer, time.Minute)

	// add item index
	indexer.Add(&Item{}, false, 0, "Name")

	// add background delete index
	indexer.Add(&Item{}, false, time.Second, "Deleted")
}

// EnsureIndexes will ensure that the required indexes exist.
func EnsureIndexes(store *coal.Store) error {
	// ensure model indexes
	err := indexer.Ensure(store)
	if err != nil {
		return err
	}

	return nil
}
{'fraction_non_alphanumeric': 0.1341324200913242, 'fraction_numerical': 0.014269406392694063, 'mean_word_length': 4.410493827160494, 'pattern_counts': {'":': 0, '<': 3, '<?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': '7345119', 'n_tokens_mistral': 686, 'n_tokens_neox': 649, 'n_words': 138}