Search Page and CSV Data Source


(John) #1

Matrix Version:

Hi,
I’m setting up a Search Page asset that needs to search within an imported CSV data source asset.
Can a ‘Search Page’ search and return CSV Data Source ‘Data source record set’ assets in the results?

Thank you in advance!


(Iain Simmons) #2

Hi @John,

I think so, though it might not index all of the fields (possibly only the asset names?).

But you can also use the Record Filter functionality of the CSV Data Source (docs mention DB Data Source, but it works the same), along with Dynamic Inputs if you are just doing simple matches on a particular column of your CSV.

Then you would just use a regular asset listing, but the query parameters in the URL would control what the Data Source actually returns and therefore what is actually listed.

Hope that helps,

Cheers,
iain


(John) #3

Thank you Iain, i’ll look into that method!
Forgive me if I have this all wrong - But I can’t even get the asset titles. I have set up a search page as per these instructions, adding only the Name search field, but no results.


(Iain Simmons) #4

Hi @John,

It’s possible that Matrix Search does not index any of the text within those “Shadow Assets”. Or, perhaps you need to manually re-index with the parent as the root node.

In any case, I think the other method is typically the way we would do this. Either that, or using JavaScript libraries like Papa Parse in Matrix Server Side JavaScript. But that’s a whole other thing :slight_smile:

Cheers,
iain


(Mark Nearhos) #5

Unless something has changed in the last few years - my understanding has always been that shadow assets aren’t indexed.
see (very) old posts like Search Page to search shadow assets and Searching or filtering shadow assets


(Iain Simmons) #6

Yes, that’s what I thought too, but I couldn’t find anything in the docs that explicitly said they weren’t, so I didn’t want to assume one way or another.

Thanks for finding and linking those other questions/answers!