Search in multiple RG: tricky question

Hello everyone,

Is it possible to search in 2 different RG in the same time?
I have a page with a main RG and a nested RG for every result of the main RG.

Examples:
– Fruits
---- ananas, apple, orange
– Vegetable
---- tomato, concomber, salade

What i want to achieve is to display the RG “fruit” when a user is searching “fruit” or “ananas”

The best i found until now is the operation “… intersect with …” but it takes two lists of things and returns the entries that are in both lists while i want to return the entries that are in minimum 1 list of the 2 browsed.

Thanks for your help!

merged with also works.

what I do is I have 1 search input
then on each RG I have a condition: if search input is not empty: datasource=

So for RG A: Do a search for a: whose search index contains inputs value
and for RG B: do a search for b: whose search index contains inputs value

Thanks Tiplister, this is what i did.

To take my example again, the problem is when i search “apple”, there is 1 entry in the RG B so it has to be displayed, but this RG is nested in RG A and this one is not displayed. So no result.

if you have a nested RG and there are issues because of this, you would need a state that is a list of things. and as soon as the search inputs value is changed, change the state, that would tell the RG to now take a different data source.
Might even need 2 states: One yes/no state that flips, and then one list of things state that is searched through instead of just the nested data.

But if i create a list of things state, what is the state type? RG A or RG B?

Oh ok I think I get it now, although I am not 100% sure what you are trying to do.
i am assuming the search is working for your normal RG but not for the nested one?

so you would need your nested one to be changed with a yes/no
(normally your nested one says current cells list of items, if someone searches, turn the yes no state to yes, if that state is yes, underneath conditional, it should instead use datasource: do a search for: items where name= inputs value.

in that case you may not need the list of things state.

I will show you a screenshot, it be more easy for you to understand:

Blue box = RG A
Red box = RG B

With your solution, the search bar will search in the blue box title “movie” so it will only work with the word “movie”.

The other solution will be to apply the search on the red box with for example “prestige” but then it will not work anymore with the word “movie”

What i want is to make a search on the red and the blue box in the same time so the words “movie” or “prestige” will both display the RG A on the page.

let us call movie genres
and the prestige and hunger games movies of that genre.

Your outer RG if input search is not empty should read:
do a search for genres (containing inputs value) merged with do a search for genres: filtered advanced filter this genres movies titles contain inputs value

Thanks TipLister

Local things= genres
Recos= movies

I tried that and it doesn’t work. I have no result.

I am sure it’s close of the solution but there is something i do wrong.

So here are some news @TipLister

Your solution is working only for:

  • Movies of the genre (RG B) but not anymore for the genre itself (RG A)
  • It’s case sensitive so if i type hunger, it’s doesnt work. Only Hunger is working. PS: i solved this problem by adding :lowercase

I am still trying to solve it. It’s close.

okay thanks for the update. I was thinking maybe case sensitive could be an issue but was not quite sure enough to post.

If you go on your preview page and inspect, do you see 0 data loaded for the first search?
What if you try to use a state on page load for the first part of your search, that is not working.?

I am surprised

Yes i see 0 data.

What if you try to use a state on page load for the first part of your search, that is not working.?

I will also try yes.

genres: filtered advanced filter this genres movies titles contain inputs value

By the way: with “advanced” contraint, it’s not possible to use “Contain Keywords” but only “Contains” so if i type “prestige” it doesn’t display “The Prestige” but if i type “The Prestige” then the RG is displayed.

I am realling making progress but still stucked with displaying RG A and also displaying results containing keywords and not only the exact value of my search box.

@Tiplister i found the solution:

I decided to include the content of the RG 2 in the table of RG1 (only the relevant text) to be able to search only in one table with the “Any field contains” instructions and it solved the two last problems in the same time!

Thanks again for your help

ok that was my next suggestion, or atleast something similar, to create a field type text for RG2, called search index, that includes the texts of all of RG2s RG1s. Glad you found it and I could somehow help.

1 Like