ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Several search filters - how best to implement

January 28, 2010 6:58am

Subscribe [1]
  • #1 / Jan 28, 2010 6:58am

    tidy

    196 posts

    I need to build a large document repository type site with EE1.6.8.

    There will be a free keyword search box on the site but the documents will also be accessible by quite a sophisticated search filtering sidebar, similar to the sidebar you get to refine your search on ebay with checkboxes beside various parameters. Here’s an example:

    By Topic
    []All
    []Literature
    []History
    []IT
    ...

    By Type
    []All
    []Journal Article
    []Report
    []Press Article

    By Region
    []All
    []Europe
    []North America

    [filter button]

    There will be a couple more filters, but that’s the basic idea.
    So, you tick all the checkboxes of interest to you e.g. literature and history articles of all types from europe, and a list of relevant articles magically appears! 😊

    The topic filter options may grow over time, but the other filters would be fixed.

    I was thinking of having topics as the category group for the weblog, and using dropdown custom fields for the other filters.

    I have only used simple site search forms to date, and going by the docs I can see how to search by category in the advanced version but I can’t see anything about custom fields.

    I’m hoping that searching on multiple filters like this is possible and would appreciate any advice on how best to go about this in EE.

    I also need to be able to link directly to certain simple searches. For example, have a text link to a page listing all European reports i.e. docs with the region custom field set to Europe, but am unsure how to achieve this either.

    I have seen posts in the forum about people using search modules on sites where search accuracy and performance is key. Would that be recommended here? I saw one such module mentioned http://www.solspace.com/software/detail/super_search/, not sure if there are others. Would this make combining my various search filters easier?

    Many thanks for your time,
    Janine.

  • #2 / Jan 28, 2010 10:02am

    ender

    1644 posts

    Are your checkboxes the various categories that an entry may be tagged with or are you searching the custom fields for this information?  If it is the former then this thread may be of some interest to you. I ended up consulting with the designer of that site to accomplish his category filter combinations using a custom SQL query and some jQuery/AJAX.

    It would also be possible to implement this with the data held in custom fields.  A good starting point for that would be dynamic parameters in the weblog:entries tag, but I suspect there may be some hurdles to overcome at some point with that.

  • #3 / Jan 28, 2010 10:24am

    tidy

    196 posts

    Hi Ender,
    Thanks for replying. I have only just realised that it is possible to associate a weblog with multiple category groups! D’oh!! :red:

    So I can see now that I can use a category group for each filter parameter, which would make direct linking to a single filter value (e.g. all european docs) easy at least. So since you think there could be hurdles with custom fields, categories for everything is a more natural choice?

    I have looked at the post you referenced. While fancy ajax/jquery effects would be lovely, my main concern at the moment is just checking that filtering on multiple values of multiple categories can be implemented e.g. search where (topic category is literature OR history) AND (region category is europe OR asia)

    So assuming that all my checkboxes are categories, can the built in advanced search handle filtering such as above, do I need a module like Super Search or are the custom SQL queries you mentioned above required?

    Many thanks,
    Janine.

  • #4 / Jan 28, 2010 11:22am

    ender

    1644 posts

    The jQuery/AJAX bit is ancillary to the main issue of getting the filter to work… you can either have a page refresh or not, it doesn’t change how the filter works.

    The best part of using different category groups is that you may come upon a case where an entry fits into multiple categories within a group (you might have a journal article about both african AND european swallows and want to show up for a search for either region).

    I don’t think that the advanced search can handle (region x or y) and (topic x or y) type searching, although I may be wrong… hopefully someone can weigh in on that one.

    I know that I can get that to work using a custom query (done exactly that in the past), however it would be tricky to also support a full-text search in addition to the category filters.  Maybe the super search module can do that, not sure.  Whenever that situation comes up in sites that we develop here I turn to Sphinx for its amazing full-text searching power.

  • #5 / Jan 28, 2010 1:11pm

    tidy

    196 posts

    Thanks for the extra info Ender.

    I’ll try playing around with the advanced search just in case the filtering I need is doable that way and I’ll look into the super search module some more on Solspace’s site/forum, because it’s supposed to have performance benefits also etc.

    If that won’t do the job, it’s good to know that you’ve definitely implemented this type of functionality before with custom queries and that we could call on your consulting services if needed.

    Thanks again,
    Janine.

  • #6 / Jan 28, 2010 2:42pm

    ender

    1644 posts

    no problem, best of luck.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases