Akopia Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [mv] Fast binary searching



******    message to minivend-users from Mike Heins <mikeh@minivend.com>     ******

Quoting B.J. Bezemer (bas.bezemer@wxs.nl):
> 
> Hi All,
> 
> I'm having a hard time to get the fast binary search option to do what I want it
> to do. It needs to return results on exact matches and ignore matches of
> substrings. I'm using mvend 3.14-5.
> 
> There is an index file that lists the category an artikel belongs
> to followed by the artikel code. The content might reveal that I'm into the
> aquatic plants business. A shortened list:
> 
> category	code

Here is your first problem -- that is not sorted. Sorting must include header
line....

> aquarium:accessories	X505
> aquarium:books	X601
> aquarium:books:cdrom	X501
> aquarium:medicine	J60159
> aquarium:medicine	J60155
> aquarium:plants	A1
> aquarium:plants:anubias	A9
> aquarium:plants:aponogeton	A18
> aquarium:plants:cryptocoryne	A50
> aquarium:plants:echinodorus	A75
> marine:accessories:meters	X711
> pond:accessories	X504
> 
> With an in-page search the results must be extracted from the above list
> (stored in the file products/category.index). A simplified presentation:
> 
> [search-region arg='mp=category']
> <table>
> [search-list]
> <tr>
> <td>[item-code]</td><td>[item-field description]</td>
> </tr>
> [/search-list]
> </table>
> [/search-region]
> 
> Definition of the search profile where [value searchcategory] has been set
> already to define the search string.
> 
> [set name=category]
> mv_dict_look=[value searchcategory]
> rf=1
> ml=16
> fi=products/category.index
> sp=@@MV_PAGE@@
> [/set]
> 
> I've been playing with the definition of di=-1 and mv_dict_end in the search
> profile but I don't have a clue on how it will affect the results.
> 
> What's the problem? 
> If mv_dict_look is set to "aquarium:plants" I want it to return artikel "A1"
> only and not the subcategories "anubias", "aponogeton" etc. The same holds for
> "aquarium:books" which should return "X601" and not "X501". Can someone help me
> out how this can be achieved, preferably with the dict_look related options.

Since you are using MV3, I cannot be sure (I will not dive back into that
source) but I am guessing you need an additional:

    co=yes
    se=[value searchcategory]
    sf=0
    op=eq

That will further screen the matches to only those that exactly match
the string.

-- 
Internet Robotics, 131 Willow Lane, Floor 2, Oxford, OH  45056
phone +1.513.523.7621 fax 7501 <mikeh@minivend.com>

Unix version of an Outlook-style virus:
It works on the honor system. Please forward this message to everyone
you know, and delete a bunch of your files at random.
-
To unsubscribe from the list, DO NOT REPLY to this message.  Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list


Search for: Match: Format: Sort by: