Kyle Williams
07/07/2021, 6:44 PMKyle Williams
07/07/2021, 6:44 PMlet searchRequests = {
'searches': [
{
'collection': 'movies',
'q': 'matrix',
'query_by': 'description'
},
{
'collection': 'user_tags',
'facetFilters': [ "tag:favorite"]
}
]
}
// Search parameters that are common to all searches go here
let commonSearchParams = {
'group_by': 'movie_id',
}
client.multiSearch.perform(searchRequests, commonSearchParams)
Jason Bosco
07/07/2021, 6:47 PMKyle Williams
07/07/2021, 6:47 PMJason Bosco
07/07/2021, 6:51 PMJason Bosco
07/07/2021, 6:53 PM{
fields: [
...
{name: "userids_tagged_.*", type: "int32[]", optional: true}
]
}
Jason Bosco
07/07/2021, 6:55 PM{
description: "...",
userids_tagged_favorite: [1, 2, 3, 4],
userids_tagged_tagx: [1, 2, 10, 42],
}
Jason Bosco
07/07/2021, 6:59 PMKyle Williams
07/07/2021, 6:59 PMKyle Williams
07/07/2021, 7:00 PMJason Bosco
07/07/2021, 7:00 PMuserids_tagged_*
fields are returned in the response...Jason Bosco
07/07/2021, 7:01 PMhow would the user be able to select from the tags only they have used?If you filter on movies that only have that particular user's ID in any of the
userids_tagged_*
fields, that achieves this right?Kyle Williams
07/07/2021, 8:26 PMuserids_tagged_tagx
, userids_tagged_tagy
but not userids_tagged_tagz
, how would the user see x
,y
available in the current search context but not z
?Jason Bosco
07/07/2021, 8:44 PMhow would the user seeĀ x,yĀ available in the current search context but notĀ zAre users searching for both movie results and tag results? Or are they searching only for movie results from the movies that they've tagged?
Kyle Williams
07/07/2021, 9:18 PMJason Bosco
07/08/2021, 12:31 AMJason Bosco
07/08/2021, 12:31 AM{
description: "...",
userids_tagged_favorite: [1, 2, 3, 4],
userids_tagged_tagx: [1, 2, 10, 42],
}
Jason Bosco
07/08/2021, 12:33 AMJason Bosco
07/08/2021, 12:37 AM[
{
collection: "movies",
q: "thriller",
query_by: "description",
filter_by: "userids_tagged_favorite:1"
},
{
collection: "movies",
q: "thriller",
query_by: "description",
filter_by: "userids_tagged_tagx:1"
},
{
collection: "movies",
q: "thriller",
query_by: "description",
filter_by: "userids_tagged_tagz:1"
},
// One query per tag - you'd have to maintain all the tags ever created on your side and use that to construct the query dynamically
]
Jason Bosco
07/08/2021, 12:40 AMuserids_tagged_tagz
, then the 3rd query above will return 0 resultsKyle Williams
07/08/2021, 4:07 PM