Why I can't return String facets?

Hi ,

I could return int factest - rational2 in shortets query, but I could not return String facets - rational.

My mutate as below:

      <0x1a>  <testRel>  <0x1c>  (rational="adabc",rational2=30,rational3=50) .

Below is my shortest query:

     path as shortest( from:0x1a, to:0x1c, depth:6, numpaths:50 ){
          testRel @facets(gt(rational,10))   @facets(rational)

    all (func:uid(path)){
         testRel @facets


Do you know the reason?

Thanks a lot!

Hi @doushubao1984, It seems that you have missed predicate in your mutation. Can you share your schema? And in your query, it should be

testRel @facets(gt(rational2,10)) @facets(rational)

as you should be doing the comparison on rational2 instead of rational (which is a string). Feel free to raise followup if this doesn’t address your problem.

Hi @doushubao1984,

There seems to be some issue with the string-type in facets. I have filed an issue comparator functions doesn't work correctly for the string type with the facets · Issue #5843 · dgraph-io/dgraph · GitHub.

Feel free to make any modifications to it.

Thanks a lot! Ahsan.
Hope to fix it in coming soon release.

1 Like