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.

Matching search to only ’some’ items

August 08, 2011 9:10am

Subscribe [2]
  • #1 / Aug 08, 2011 9:10am

    I’m looking at a sort of directory with a search function. The entries have a lot of custom fields and essentially the search is a way to find entries that match certain criteria.

    An analogy might be a restaurant search, and the criteria might be things like:

    Serves vegetarian food
    Has outdoor seating
    Can seat 50 people
    etc

    So far so good and Solspace Super search will get me so far.

    My problem is that with a relatively small list of “restaurants”, all with lots of data, the possibility of getting zero matches is quite high.

    So, what we’d like to do is return the “best” matches. e.g. the top 3 restaurants in terms of the number of criteria matched. Is there an existing way to do this without diving into bespoke PHP or module development?

    I can see how if it was generic enough it might be used in other areas quite successfully.

    None of the input fields will be free text.

    [Mod Edit: Moved to the Community Help forum]

  • #2 / Aug 09, 2011 7:32am

    I’ve had a few more thoughts and am thinking this could be done with a ‘scoring’ mechanism, so for each item matched, the restaurant would score a point and the results would be ranked by that score.

    The search could be further refined by adding weighting either to all the results (i.e. we decide that vegetarian food will bump the restaurant further up the list tah outdoor seating) or the user could also weight it on their side (i.e. “how important are each of the following to you”)

    Just trying to flesh out the possibilities that might mean other people could use this for a wider variety of applications?

  • #3 / Aug 09, 2011 7:42am

    Steven Grant

    894 posts

    Have you looked at Low’s search module? http://devot-ee.com/add-ons/low-search

  • #4 / Aug 09, 2011 8:38am

    I got the impression that this is really down to text searching. i.e. one input, searching across several fields.

    What I need is lots of inputs, matching across lots of matching fields - more like solspace super search. A query is probably a better name for it than search.

    The difference between what I need, and what super search does is that rather than a strict AND query (vegetarian = 1 AND outside = 1) what I need is something more like :

    vegetarian = 1 OR outside = 1 ORDER BY (the number of criteria that matched)

    It’s calculating and weighting he last bit that is the crucial difference.
    I think I could probably do this as a one-off job, but maintaining it will become a complete PITA. I imagine the available attributes will change a lot as the site develops.

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

ExpressionEngine News!

#eecms, #events, #releases