Improved search query

This commit is contained in:
Grzegorz Leoniec 2019-02-18 16:57:17 +01:00 committed by Matt Rider
parent 360acdb141
commit 6a146aa699

View File

@ -4,8 +4,12 @@ type Query {
findPosts(filter: String!, limit: Int = 10): [Post]! @cypher( findPosts(filter: String!, limit: Int = 10): [Post]! @cypher(
statement: """ statement: """
CALL db.index.fulltext.queryNodes('full_text_search', $filter) CALL db.index.fulltext.queryNodes('full_text_search', $filter)
YIELD node YIELD node as post, score
RETURN node MATCH (post)<-[:WROTE]-(user:User)
WHERE score >= 0.2
AND NOT user.deleted = true AND NOT user.disabled = true
AND NOT post.deleted = true AND NOT post.disabled = true
RETURN post
LIMIT $limit LIMIT $limit
""" """
) )