This commit is contained in:
John Giannelos 2019-11-26 16:03:26 +01:00
Родитель e6da53b707
Коммит c9df259c25
2 изменённых файлов: 1 добавлений и 25 удалений

Просмотреть файл

@ -3,7 +3,7 @@ webcompat-search
Description
-------------
Web service to expose HTTP API that allows searching webcompat issues based on:
Utility to help with common tasks related to webcompat ES:
* flask
* elasticsearch

Просмотреть файл

@ -5,7 +5,6 @@ from flask import Blueprint, url_for
from flask.json import jsonify
from elasticsearch import Elasticsearch
from elasticsearch.helpers import scan as es_scan
from webcompat_search import settings
@ -33,29 +32,6 @@ def get_schema():
return jsonify(schema)
@blueprint.route("/domain/<domain>")
def get_domain(domain):
"""Query for issues based on domain"""
es = Elasticsearch([settings.ES_URL], **settings.ES_KWARGS)
query = {"query": {"term": {"parsed_url.netloc.keyword": domain}}}
results = es_scan(
es,
index=settings.ES_WEBCOMPAT_INDEX,
query=query,
scroll=settings.ES_SCROLL_LIMIT,
size=settings.ES_QUERY_SIZE,
preserve_order=True,
)
docs = []
for result in results:
docs.append(result["_source"])
return jsonify(results=docs)
@blueprint.route("/dashboards/")
def get_dashboards():
"""Return list of available dashboards"""