Merge 75019b9b22 into d6ff7bb78c
This commit is contained in:
commit
ec78dc4ded
1 changed files with 8 additions and 9 deletions
|
|
@ -214,17 +214,16 @@ async def edge_fulltext_search(
|
||||||
for r in res['hits']['hits']:
|
for r in res['hits']['hits']:
|
||||||
input_ids.append({'id': r['_source']['uuid'], 'score': r['_score']})
|
input_ids.append({'id': r['_source']['uuid'], 'score': r['_score']})
|
||||||
|
|
||||||
|
filter_query = filter_query + ' AND id(e)=id ' if filter_query else ' WHERE id(e)=id '
|
||||||
|
|
||||||
# Match the edge ids and return the values
|
# Match the edge ids and return the values
|
||||||
query = (
|
query = (
|
||||||
"""
|
"""
|
||||||
UNWIND $ids as id
|
UNWIND $ids as id
|
||||||
MATCH (n:Entity)-[e:RELATES_TO]->(m:Entity)
|
MATCH (n:Entity)-[e:RELATES_TO]->(m:Entity)
|
||||||
WHERE e.group_id IN $group_ids
|
"""
|
||||||
AND id(e)=id
|
+ filter_query +
|
||||||
"""
|
"""
|
||||||
+ filter_query
|
|
||||||
+ """
|
|
||||||
AND id(e)=id
|
|
||||||
WITH e, id.score as score, startNode(e) AS n, endNode(e) AS m
|
WITH e, id.score as score, startNode(e) AS n, endNode(e) AS m
|
||||||
RETURN
|
RETURN
|
||||||
e.uuid AS uuid,
|
e.uuid AS uuid,
|
||||||
|
|
@ -240,7 +239,7 @@ async def edge_fulltext_search(
|
||||||
e.invalid_at AS invalid_at,
|
e.invalid_at AS invalid_at,
|
||||||
properties(e) AS attributes
|
properties(e) AS attributes
|
||||||
ORDER BY score DESC LIMIT $limit
|
ORDER BY score DESC LIMIT $limit
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
records, _, _ = await driver.execute_query(
|
records, _, _ = await driver.execute_query(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue