Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extending Orchard Search and Indexing

We need to provide search options for users to find content based on specific field values.

We're developing a Training Course module for a client but the standard search looks for the text in any indexed field. We want to allow users to find courses based on searches against specific fields (i.e. Course Type, Location, Price, Date).

We've extended the search to check against specific fields but can't work out how to get the URL parameters passed by the Search form as a GET.

Where does Orchard put URL parameters?

Also, are we missing something, is there a way that Orchard already supports this that we haven't realized?

like image 995
e64 Avatar asked Nov 14 '22 11:11

e64


1 Answers

I would suggest you to copy part of the Search module, more specifically the Controller and the View and then modify it to suit your specific needs. I see you are actually modifying the original module, but this might be a problem on the long term, for instance if we start updating the module you might either lose you changes or have to reapply them to the code base. In the end you will target a MySiteName.Search module. And you can also add custom routes, custom settings.

On a side note the Search API is really powerful and you can even use it to do faceted search, or search on inherited taxonomy terms, tags, full text, ranges, ... Having your own controller code will let you use all of these features easily.

like image 101
Sébastien Ros - MSFT Avatar answered Dec 19 '22 16:12

Sébastien Ros - MSFT