def index_settings(shards=5, replicas=2):
    """Configure an index in ES with support for text transliteration."""
    return {
        "index": {
            "number_of_shards": str(shards),
            "number_of_replicas": str(replicas),
            # "refresh_interval": refresh,
            "analysis": {
                "analyzer": {
                    "latin_index": {
                        "tokenizer": "standard",
                        "filter": ["latinize"]
                    },
                    "icu_latin": {
                        "tokenizer": "standard",
                        "filter": ["latinize"]
                    },
                    "latin_query": {
                        "tokenizer": "standard",
                        "filter": ["latinize", "synonames"]
                    }
                },
                "normalizer": {
                    "latin_index": {
                        "type": "custom",
                        "filter": ["latinize"]
                    }
                },
                "filter": {
                    "latinize": {
                        "type": "icu_transform",
                        "id": "Any-Latin; NFKD; Lower(); [:Nonspacing Mark:] Remove; NFKC"  # noqa
                    },
                    "synonames": {
                        "type": "synonym",
                        "lenient": "true",
                        "synonyms_path": "synonames.txt"
                    }
                }
            }
        }
    }