Include aditional items on search results

Topics: General, Writing modules
Aug 25, 2011 at 6:09 PM

I'm in a process on learning if Orchard is best suited for what a customer has asked us to implement.

We need a way to combine the search module wich orchard provides, wich indexes contents of the site, with a second search engine wich querys a internal system.

So, when the user press the search button on any page, the query is sent to the orchard's search module and to the internal search module at the same time, and the results then are presented to the user combined (maybe on two different columns).

What would it take to develop such a feature for us? Would we have to modify the search module in orchard or this module has known extensibility points to do something like this? Is this a easy thing to do or a complex/tricky/hacky thing?

I'm not asking for a full implementation or detailed steps, just an opinion from colleages who are much more experienced than I on this software

Aug 25, 2011 at 10:32 PM

As the results from the other system should point to another system, I would suggest to create two different indexes. You can do it easily, by creating a specific controller to handle those search queries, and a task (background maybe) to index the other system.

In orchard there are two separate notions for Search and Index. You can create as many indexes as you want, with what you want. And there is a Search API to search in those indexes. We made a specific usage of it to index content items, and to create a search form looking in that index.

Aug 26, 2011 at 12:49 PM
Edited Aug 26, 2011 at 12:50 PM

Sebastienros, thanks for your response.

In this case, the index is external, we have a dms wich indexes tons of documents and we need to pass the search tearms to this index and then present results combined to the user (cms content+dms documents).

If I'm reading you well, this should be feasible by creating a controller that coordinate both indexes and then presents results to the user in a custom view, skipping the search module all together, right?

Aug 26, 2011 at 5:33 PM

Yes, you can skip the search module, and do the search queries by yourself.