Hi,
I have a general question regarding search using dgraph. I wish to search on a text as regular expression but want to have the exact matches ranked higher. Is there a way to do this? I am trying to use the following but the “cond” code throws an error.
Thanks
query test($nam: string = "sty")
{
q1 as var (func:eq(dgraph.type,Xtype)) @filter(regexp(name,/$nam/)) {
myn as name
vx as math(cond(myn==$nam,1,2))
}
q2 (func:uid(q1),orderasc:val(vx)){
name
}
}