Hey guys, was wondering how soon the <OR on filter...
# community-help
c
Hey guys, was wondering how soon the OR on filter_by would be introduced? Also if there's any example of the multi-query workaround when using the instantsearch adapter 🤔
👍 1
k
We're targeting in the next 2-3 months timeframe. @Jason Bosco should be able to help with the instant search workaround in the meantime.
❤️ 2
j
@Carl The instantsearch adapter already generates multi_search requests for you. Could you elaborate on what you're looking to do?
c
Ah great, thanks for the timeframe! Essentially, we want to offer a flexible search. So, if the user searches: green banana It'll use the normal
q
paramter. However, if the user searches: 9039274026622 634991 We would then identify that those two numbers match a specific length (after splitting on a space). However, one number targets the product's EAN (9039274026622), the other targets a product ID (634991). This query should then be sent to
filter_by
on
ean
and
product_id
as
OR
based query. Hope that makes sense. I have tried setting
facetFilters
on the
<Configure>
which works, though it is joining them with
AND
as we would expect. So was wondering if I could hack my way around it somehow
@Jason Bosco I know you're a busy man and there's been a weekend. So just pinging you in case this got lost 😊
k
I'll let Jason respond about the front end question but for this specific use case, if you stored both the ean and ID in the same field as an array you can essentially avoid needing to make two queries. You can just do: id_ean: [903927, 634991] This will do an OR within the same field.
c
Oh, that's an interesting workaround! Certainly something we can consider 🙂 Thanks for that idea
j
@Carl On the Instantsearch side, I think you'd need to most likely build a custom widget that inherits from the existing searchBox widget, where you'll have more control over the exact search / refinement queries that get generated...
That said, I think it might be more efficient to solve this particular use case using the approach Kishore mentioned above or by setting up a Dynamic Filtering rule on the ean and product_id fields.
c
Alright, think I have a good idea on where I can go with this for now. Cheers for the help guys, great as usual 👍
k
Welcome!