diff --git a/treeherder/services/elasticsearch/__init__.py b/treeherder/services/elasticsearch/__init__.py deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/treeherder/services/elasticsearch/mapping.py b/treeherder/services/elasticsearch/mapping.py deleted file mode 100644 index a17e8282b83..00000000000 --- a/treeherder/services/elasticsearch/mapping.py +++ /dev/null @@ -1,47 +0,0 @@ -boolean = {"type": "boolean"} -integer = {"type": "integer"} -keyword = {"type": "keyword"} - -DOC_TYPE = "failure-line" -INDEX_NAME = "failure-lines" - -INDEX_SETTINGS = { - "failure-lines": { - "mappings": { - "failure-line": { - "properties": { - "job_guid": keyword, - "test": keyword, - "subtest": keyword, - "status": keyword, - "expected": keyword, - "best_classification": integer, - "best_is_verified": boolean, - "message": { - "type": "text", - "analyzer": "message_analyzer", - "search_analyzer": "message_analyzer", - }, - }, - }, - }, - "settings": { - "number_of_shards": 1, - "analysis": { - "analyzer": { - "message_analyzer": { - "type": "custom", - "tokenizer": "message_tokenizer", - "filters": [], - }, - }, - "tokenizer": { - "message_tokenizer": { - "type": "pattern", - "pattern": r"0x[0-9a-fA-F]+|[\W0-9]+?", - }, - }, - }, - }, - }, -} diff --git a/treeherder/services/elasticsearch/utils.py b/treeherder/services/elasticsearch/utils.py deleted file mode 100644 index fb9828cc637..00000000000 --- a/treeherder/services/elasticsearch/utils.py +++ /dev/null @@ -1,53 +0,0 @@ -def dict_to_op(d, index_name, doc_type, op_type="index"): - """ - Create a bulk-indexing operation from the given dictionary. - """ - if d is None: - return d - - op_types = ("create", "delete", "index", "update") - if op_type not in op_types: - msg = 'Unknown operation type "{}", must be one of: {}' - raise Exception(msg.format(op_type, ", ".join(op_types))) - - if "id" not in d: - raise Exception('"id" key not found') - - operation = { - "_op_type": op_type, - "_index": index_name, - "_type": doc_type, - "_id": d.pop("id"), - } - operation.update(d) - - return operation - - -def to_dict(obj): - """ - Create a filtered dict from the given object. - - Note: This function is currently specific to the FailureLine model. - """ - if not isinstance(obj.test, str): - # TODO: can we handle this in the DB? - # Reftests used to use tuple indicies, which we can't support. - # This is fixed upstream, but we also need to handle it here to allow - # for older branches. - return - - keys = [ - "id", - "job_guid", - "test", - "subtest", - "status", - "expected", - "message", - "best_classification", - "best_is_verified", - ] - - all_fields = obj.to_dict() - return {k: v for k, v in all_fields.items() if k in keys}