Announcement

Collapse
No announcement yet.

Search on number ranges

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

    Search on number ranges

    Hi,

    We are looking to add some searchable attributes to our products to enhance the search function on our site.

    Some of the attributes are number values, it would be good if they good be searched by range.
    For example, search for all products where the current consumption is less than 10mA.
    However I can only see how a search could be setup for a=b not a<b or a>b.

    Has anyone got any ideas how a search like this could be implemented?
    <a href="http://www.rfsolutions.co.uk">RF Solutions Ltd - Remote Control, Bluetooth, Zigbee, RFID, GSM and GPS Products</a>

    #2
    Hi,

    Have you had a look at the Advanced Users Guide? On page 55 you will find 'Manual Configuration of Advanced Searching' which should help you to an extent. You will otherwise have to look at javascript to get a solution.

    Kind regards,
    Bruce King
    SellerDeck

    Comment


      #3
      I'm trying to do something like this too and would be delighted if someone could help.

      The idea is that people should be able to find products by the length of the flap side of an envelope, or the non-flap side, or both. But what I want to do ideally is match to a range where there is a variable parameter within which the search will find results.

      For instance, lets say you have a piece of paper you want to put in an envelope and your paper measures 138mm x 135mm. You would put in these measurements and if the 'variable' was 5mm for example, it would find any envelopes that are between 138mm and 143mm long by 135mm x 140mm wide. And so it would find a range we have that are 140x140.

      Take a look at this very rudimentary beginning:

      http://www.dummy-run.com/acatalog/search[6].htm

      Currently this only returns a result where there is an exact match to any of our product sizes.

      If anyone knows the way I can put in this variable to create the range, I would happily reward them !

      Thanks
      Richard
      www.worldofenvelopes.com

      Comment


        #4
        Richard,

        I think you need to follow the instructions on this bit..
        Joining Search Terms Together in Different Ways
        You can also edit the 'customsearch.fil' file to join the search terms together in more complex ways. For instance, in the case of a catalogue of films, you may wish people to choose either the director or the star of the movie they want, and then choose what genre (Thriller, Comedy etc.) of film they are interested in. E.g. "Find all action films starring Harrison Ford or directed by Steven Spielberg."
        If you set up 'Director', 'Star' and 'Genre' as custom properties and set up the 'Searchable Properties' tab to search on them, the 'customsearch.fil' file generated would look something like the following:
        1
        Text!SS!TB
        Text Property!S_Director1_0
        And
        Text Property!S_Star1_1
        And
        Text Property!S_Genre1_2
        And
        This file would still search on keywords, and would only find films that contain the director AND the star AND the genre chosen. You could make the 'Director' and 'Star' fields both optional (to allow people to search on either) but you could not search on the director OR the star at the same time, and then look for the genre.
        However, you can do this by changing 'customsearch.fil' to something like the following:
        1
        Text Property!S_Director1_0
        Text Property!S_Star1_1
        Or
        Text Property!S_Genre1_2
        And
        This code removes the references to the keyword search (allowing you to remove the keyword search box from the search page) and changes how the search properties are joined together. Online, the search would act on this file in the following way:
        1. It would firstly see line 2 and find all the films of the chosen director (e.g Steven Spielberg). It makes a list of them and stores them this list in its memory
        2. It then would read line 3 and find all the films starring the chosen star (e.g. Harrison Ford) and adds this list to the director list and holds it in its memory.
        3. The 'Or' in line 4 tells the search to combine both lists into one. If it was an 'And' then the search at this point would disregard all films starring Harrison Ford that were not directed by Steven Spielberg (and vice versa)
        4. The search reads line 5 now and finds all the films of the chosen genre (e.g. Action), makes a list of them and stores them in its memory.
        5. The 'And' in line 6 means that it will firstly compare the genre list with the director and star list, keeping the products that match. It disregards all the products that do not fulfil either criteria.
        6. The products that match the required criteria are then displayed in the results page.
        Remember that the 'And' or 'Or' command refers to how the preceding line is to be combined with the results gathered so far.
        Kind regards,
        Bruce King
        SellerDeck

        Comment

        Working...
        X