PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

greater than or less than searches?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • greater than or less than searches?

    Is there a way to customize Zoom Search to do "greater than X" and "less than X" searches? For example, I want to search nutrition fields in an Access database with a search option like this:

    "Find all recipes that contain less than 5 grams of fat."

    I checked out the Zoom Search Engine FAQ - Indexing databases thread but did not find an answer. We have set up nutrition fields (columns) in the database and have entered all the numeric data values. We are not trying to do > < math from a nutrition list like you see on a cereal box. That would be well nigh impossible to do.

    Our alternative is to do custom ASP coding that searches the .db database and returns the results to a page other than the Zoom search results page. The problem with this is that searches from this custom search form would not show up in the Zoom Search log. Is there a way to integrate? I'm sorry of I sound a bit green and fuzzy. I am new to this level of code tweaking.
    Last edited by rschletty; Feb-05-2009, 09:28 PM.

  • #2
    Have a look at the custom meta fields feature (in the Users Guide).
    There is also a similar demo here, with the ability to search for maximum price.

    Comment


    • #3
      Yes, the Numeric data type for Custom Meta Fields can perform the following search criterias:

      Exact match
      Less than
      Less than or equal to
      Greater than
      Greater than or equal to
      --Ray
      Wrensoft Web Software
      Sydney, Australia
      Zoom Search Engine

      Comment


      • #4
        Awesome! This is good news. Thank you.

        Comment


        • #5
          However, just to clarify, there is no way to have both a >= and a <= on the same numeric value,

          so there is no way to find all recipes that have more than 3grams of fat, but less than 10grams.

          That is too bad.

          Comment


          • #6
            I just realized a hack workaround. If you duplicate the item as a different meta value, so if your recipe has GRAMS = 5, then create a GRAMS2 = 5, then create a custom field for GRAMS as being >= and GRAMS2 as <= and it will work. However, it returns both fields on the results page, so it looks kinda bad.

            But fortunately for me, Im using cgi/xml so I can post-process my results and not show GRAMS2 in this scenario. I lost a feature (highlighting - I still want that back, btw ) with cgi/xml. I guess now I gain a feature!

            Comment


            • #7
              We had thought about doing a Range match but it was left on the list as something for the future (given that we weren't sure how many people would even bother with setting up the Custom Meta Fields as it is). If there's enough demand, we will certainly consider it for the future.

              Originally posted by danf View Post
              I just realized a hack workaround. If you duplicate the item as a different meta value, so if your recipe has GRAMS = 5, then create a GRAMS2 = 5, then create a custom field for GRAMS as being >= and GRAMS2 as <= and it will work. However, it returns both fields on the results page, so it looks kinda bad.
              You can hide the redundant field via CSS. Because each meta field has its own CSS class, you can suppress any or all of them with the "display: none" attribute.

              Originally posted by danf View Post
              But fortunately for me, Im using cgi/xml so I can post-process my results and not show GRAMS2 in this scenario. I lost a feature (highlighting - I still want that back, btw ) with cgi/xml. I guess now I gain a feature!
              We'll probably revisit the highlighting in a few weeks time. We just need to determine what is the best (most accepted) way of doing it, without breaking other users handling of the current XML, and maintain OpenSearch compatibility.
              --Ray
              Wrensoft Web Software
              Sydney, Australia
              Zoom Search Engine

              Comment


              • #8
                Thanks for your ideas. There is no need to do a range. In most cases < X will do fine. In other words, people want to find recipes low in calories, sodium, fat, carbs, cholesterol, sugars, etc. But they only search on one value at a time. They may also want to look for recipes high in fiber. That would be a > search. Here are the columns as they appear in Access:

                Comment


                • #9
                  Adding a range with Custom Meta Tags

                  [QUOTE=Ray;12218]We had thought about doing a Range match but it was left on the list as something for the future (given that we weren't sure how many people would even bother with setting up the Custom Meta Fields as it is). If there's enough demand, we will certainly consider it for the future.



                  Hi, I was wondering if you have given any more thought to allowing a range to be created in the search page. I am working on a real estate site and would like to have a range that people could plug in for $ min and max. (as they do on craigslist for example). If I just set a maximum dollar amount only, you would pull a lot of homes that you had no interest in.

                  Thank you

                  Comment


                  • #10
                    We haven't had much demand for it yet, but we're noting your request. If there's more demand we might include it in a V6.1 release.

                    Note the workaround that Danf suggested above in this thread. That is, you can achieve the same result at the moment using two tags/fields with the same value on the page, but indexed differently, and use CSS to suppress the redundant field from showing in the search results.
                    --Ray
                    Wrensoft Web Software
                    Sydney, Australia
                    Zoom Search Engine

                    Comment

                    Working...
                    X