Hi team, I saw that the <Pull Request #2409> is me...
# community-help
z
Hi team, I saw that the Pull Request #2409 is merged, so I pull the v30.0.rc4 to try out faceting by reference function. However, it seems like it's not working. The facet for the reference field is not returned at all, and even the fields after the reference fields are not returned. For example, when I do this:
Copy code
{
  "searches": [
    {
      "collection": "leads",
      "facet_by": "status, $lead-contact-linkages($wa-bot-contacts(sequence_ids)), owner",
      "q": "*"
    }
  ]
}
Only the facet for
status
is returned.
k
Can you try on the latest version just to be sure:
30.0.rc6
z
Ok sure
k
Also please post a small reproducible snippet like this: https://gist.github.com/jasonbosco/7c3432713216c378472f13e72246f46b
z
I have tried out using 30.0.rc6 and sill not getting the facet. Ok sure I'll try to do that.
k
Ok please provide a reproducible snippet.
z
Hi, can you try to run this script and verify that the
first_name
is not returned in
facet_counts
? https://gist.github.com/seowzhenjun0126/c6d73de222823786f14b8ba3020fc9be
k
@Harpreet Sangar
z
Interestingly, if the
facet_by
only includes the reference field (in this case
$authors(first_name)
), then the facet is returned correctly.
h
@Zhen Jun You'll have to specify Join in
filter_by
to use the
facet_by
feature. So you'll have to specify
$lead-contact-linkages($wa-bot-contacts(id:*))
in filter_by to facet_by on
$lead-contact-linkages($wa-bot-contacts(sequence_ids))
.
z
@Harpreet Sangar Thanks for your reply! I have updated the gist to include the collection to join in
filter_by
, but the facet is still not returned. Could you run the gist and see if you are able to reproduce the error?
h
Okay I'll check.
@Zhen Jun Can you confirm if sending only
$authors(first_name)
in facet_by produces results for you?
Sorry, just read you message. Maybe there's something off with parsing.
Even
$authors(first_name), title
produces results but not other way around.
z
Yes, sending only that will work, but adding
title
causes the
first_name
to not return
h
z
Hi, I am facing another issue here. The joined facets seems to return incorrect result if I use LEFT JOIN in filter_by. Can you have a look at this gist? There are 2 queries, and the one with LEFT JOIN (id:* || ...) returns incorrect result. Thanks! https://gist.github.com/seowzhenjun0126/bd8416edaa1bc7f093152a78280c658d
👀 1
Hi @Harpreet Sangar, were you able to reproduce the error? Feel free to let me know if you need further clarification, thanks for your help!
h
I haven't been able to pick up this issue yet. I'll inform you once I do.
z
Sure, thanks for your help!
j
hi all, sorry to hijack this thread but, but i was testing with rc10 with facets on a joined collection and got 1 facet to return successfully thanks to this thread however, when i try adding a 2nd facet from that collection it always returns 0 results Eg
Copy code
filter_by: $authors(id:*),
facet_by: $authors(first_name, last_name)
(assuming the document had a last_name) from the PR's tests, it seems like it should work?
h
Hi Jimmy, can you open a github issue and share a minimal example like?https://gist.github.com/jasonbosco/7c3432713216c378472f13e72246f46b
j
ok, will do
h
Thanks!
j
Hi @Harpreet Sangar i have created https://github.com/typesense/typesense/issues/2535 Thank you