Improved search query

This commit is contained in:
Grzegorz Leoniec 2019-02-18 16:57:17 +01:00
parent da804e26ae
commit cbbd33301f
No known key found for this signature in database
GPG Key ID: 3AA43686D4EB1377

View File

@ -4,8 +4,12 @@ type Query {
findPosts(filter: String!, limit: Int = 10): [Post]! @cypher(
statement: """
CALL db.index.fulltext.queryNodes('full_text_search', $filter)
YIELD node
RETURN node
YIELD node as post, score
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
"""
)