app/views.py
def history_query():
    """
    AND query over all active history terms
    """
    terms = active_history_terms(session['history'])
    body = {
        "_source": ["entity"],
        "fields": ["entities", "title"],
        "query": {
            "constant_score": {
                "filter": {
                    "terms": {
                        "file": terms,
                        "execution": "and"
                    }
                }
            }
        }
    }
    r = es.search(body=body, index=es_index, size=100)
    data = r['hits']['hits']
    graph = make_response(json.dumps(document_graph(data)))

    return graph

    AND query over all active history terms
    
AND query over all active history terms
AND query over all active history terms
def history_query():
    terms = active_history_terms(session['history'])
    body = {
        "_source": ["entity"],
        "fields": ["entities", "title"],
        "query": {
            "constant_score": {
                "filter": {
                    "terms": {
                        "file": terms,
                        "execution": "and"
                    }
                }
            }
        }
    }
    r = es.search(body=body, index=es_index, size=100)
    data = r['hits']['hits']
    graph = make_response(json.dumps(document_graph(data)))
    return graph
def history_query ( ) : terms = active_history_terms ( session [ 'history' ] ) body = { "_source" : [ "entity" ] , "fields" : [ "entities" , "title" ] , "query" : { "constant_score" : { "filter" : { "terms" : { "file" : terms , "execution" : "and" } } } } } r = es . search ( body = body , index = es_index , size = 100 ) data = r [ 'hits' ] [ 'hits' ] graph = make_response ( json . dumps ( document_graph ( data ) ) ) return graph
AND query over all active history terms
AND query over all active history terms
"""
    AND query over all active history terms
    """