1

I built a custom module that has its own group of tables that holds the data, it uses mcp.module_name and mod.module_name for the back/frontend

I want to know if there is a hook or some api that allows for EE's native search to display results from my custom module?

I know I can write my own search feature for my module.

If that is not possible, is there an add-on that allows for me to search for both channel entries and custom module entries?

I looked into low's search and solspace's, and their summary did not hint at that.

Any help is appreciated, thanks.

4

Short answer: Nope.

Slightly longer answer: native search, Super Search and Low Search all use the Channel module in some shape or form to display search results. Combining channel entries with other content types in a single tag is currently very cumbersome, if not impossible. Basically, EE's current API simply isn't built for that sort of thing.

You'd have to look at some other form of searching if you want to mix content types in a single stream of entries. For example, a more output-focussed search, like Google site search.

| improve this answer | |
3

No, there's no hook, but depending on the amount of data you want included, you can get the data included in searches (be it native EE, Low Search or SolSpace search).

I had the same issue with Expresso Store that the modifiers (colour/size) didn't appear in the search results - only SKUs were included by default.

You'll need to have some sort of fieldtype for this to work, then you save the data in there. In the example of Store, it holds all it's data in it's own table, and although there is a new column in the channel_data table (field_id_xx), it's not used by the module and doesn't appear when editing the entry. But what's key is that EE will use this column for searching purposes - so you can load whatever you like in there for the search results. So for Store, upon saving an entry in the backend, I parse through the store fields (price, modifier name, option name, etc), then include that raw data in the field. As mentioned, it's not used by Store on the frontend or backend, so no consequences.

In a fieldtype there's a method that can be added called "third_party_search_index" which allows you to load additional search data (so it's not stored in the channel_data table) for other search add-ons.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.