Commit 02de727d authored by Fabien Maniere's avatar Fabien Maniere

Merge branch '385-dev-no-trashed-documents-in-ngrams-contexts' into 'dev'

[gql] don't return trashed contexts when fetching contexts by terms

See merge request !458
parents 706734c5 e5402444
Pipeline #7991 passed with stages
in 49 minutes and 20 seconds
......@@ -187,7 +187,8 @@ getContextsForNgramsTerms cId ngramsTerms True = do
JOIN nodes_contexts ON contexts.id = nodes_contexts.context_id
JOIN ngrams ON context_node_ngrams.ngrams_id = ngrams.id
WHERE nodes_contexts.node_id = ?
AND ngrams.terms IN ?
AND nodes_contexts.category > 0
AND ngrams.terms IN ?
GROUP BY
contexts.id,
nodes_contexts.score,
......@@ -230,7 +231,8 @@ getContextsForNgramsTerms cId ngramsTerms _ = do
JOIN nodes_contexts ON contexts.id = nodes_contexts.context_id
JOIN ngrams ON context_node_ngrams.ngrams_id = ngrams.id
WHERE nodes_contexts.node_id = ?
AND ngrams.terms IN ?) t
AND nodes_contexts.category > 0
AND ngrams.terms IN ?) t
-- ORDER BY t.doc_count DESC
ORDER BY t.score DESC
|]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment