Continuing the discussion from Ordering of results in `anyofterms` query:
@MichelDiz forgive me, but I am not seeing an existing feature request, so I am creating this one.
Experience Report for Feature Request
What you wanted to do
Do term based matching and order by best matching first.
What you actually did
Why that wasn’t great, with examples
Because now my head hurts. (See example above)
Any external references to support your case
It can be done with SQL type languages using
CASE in the
ORDER BY clause:
It can sort of be done using field weights against a MongoDB:
Here is an approach for ordering based upon matched string length vs. total string length in SPARQL:
All of these do seem more like hacks than actual true solutions, but even a hack isn’t available with pure GraphQL. I think it is possible with DQL, but trying to utilize this functionality on GQL to enable deep nested graphs.