How does one order the results of a anyofterms
based query?
The expectation is that the most relevant matches would be at the top of the result set, but this is not the case.
Example: Try the following on https://docs.dgraph.io/query-language/#term-matching
{
me(func: anyofterms(name@en, "Judith Jones"), first: 10) {
name@en
}
}
This gives the following result set:
{
"data": {
"me": [
{
"name@en": "Una Brandon-Jones"
},
{
"name@en": "Sasha Frere-Jones"
},
{
"name@en": "Judith Jones"
},
{
"name@en": "Damon Jones"
},
{
"name@en": "Cheyenne Jones"
},
{
"name@en": "Emily Jones"
},
{
"name@en": "Sarah Jones"
},
{
"name@en": "Chester Jones III"
},
{
"name@en": "Ike Jones"
},
{
"name@en": "Richard T. Jones"
}
]
}
}
Clearly “Judith Jones” is the best match and should be at the top.
Is there a way to get access to the score from the underlying bleve
engine? That way we would be able to order the results.