Quick question about getting search results. I hav...
# community-help
m
Quick question about getting search results. I have some user data similar to this:
Copy code
{
  ...
  name: 'John Deere',
  organizationIds: [123, 234, 456]
},
{
  ...
  name: 'Jane Doe',
  organizationIds: [890, 765]
}
When I make the search, I would like to search by
name
, But I only want to see results for documents that have
123
in their organizationIds array. So in the case above I would type “J” in the search input, but only
John Deere
would be returned. I see that I can use
filter_by
in the search options. However, it doesn’t look like I can do any sort of array check like
value in array
. What is the best way to handle this?
j
@Michael.M There are a couple of array filtering examples under the
filter_by
row in this table: https://typesense.org/docs/0.22.2/api/documents.html#query-parameters Search for "Filtering Arrays"
m
Oh perfect! I was looking at a totally different table it seems
Thank you
👍 1
Ok I figured out why the table was different. The google link I had clicked on referenced documentation for an older version of the API
j
Ah yeah... We've tried setting page priorities in the sitemap, but Google still weights some of the older version pages higher 😞
m
No problem. I’ll do better at checking the version number at the top
a
Page priorities are mostly ignored by google from my experience. You can always use the robots.txt if this becomes a bigger issue.