[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] Fast binary searching
****** message to minivend-users from "B.J. Bezemer" <bas.bezemer@wxs.nl> ******
Hi Mike,
That eliminated some of the unpredictable results and I think I've got an
acceptable solution for my situation now.
> > category code
>
> Here is your first problem -- that is not sorted. Sorting must include
header
> line....
My first problem was that the header of the index file didn't start with a
leading space. I thought I made arrangements to do so, following your
suggestions
http://www.minivend.com/minivend/minivend-list/1999/msg00844.html ).
However the [tag op=log file=">filename"] catsubcat code[/tag] seems to
eliminate the leading space in the constructed index file. Instead of a
space I use a "!" now. Also low in the ascii hierarchy and it works fine.
Something like: [tag op=log file=">products/category.index"]!catsubcat
code[/tag].
The second problem that disturbed my results was that ":" which I used to
separate the different levels within my category structure (as in
"aquarium:reference:cdrom") has a special meaning within minivend. Some sort
of alternative for a space which probably resulted in the definition of
three words to be search for (aquarium, reference and cdrom) instead of one
unique string. Substitution of the ":" with an underscore solves all your
problems (like "aquarium_reference_cdrom").
My complete definition of something workable is now:
<!--
[search-region arg='mp=category']
-->
<table>
[search-list]
<tr>
<td>[item-code]</td><td>[item-field description]</td>
</tr>
[/search-list]
</table>
[/search-region]
[set name=category]
mv_dict_look=[value searchcategory]
di=-1
rf=1
ml=16
fi=products/category.index
sp=@@MV_PAGE@@
[/set]
Your sugestion on the coordinated search option (co=yes etc. ) is not needed
at all. Only completely matching strings are returned and substrings are
ignored. So searching for "aquarium_reference" will not return any results
matching "aquarium_reference_cdrom". If you DO want the latter to be
included in the results you have to turn substring matching on (su=1) within
the search profile or in the definition of the search region.
One last problem though. As you can see the in page [search-region]
definition is placed within html comment codes (<!-- and -->). If the search
results exceed the maximum per page (16 in my case) the subsequent pages
will show some leftovers of the search region definition like "]. The
comment codes hide this but it is clearly a fix. Has anyone something more
elegant to solve this? Than I can show it to my mom and she can be proud at
last. And I get to choose what we have for diner.
Regards,
Bas Bezemer
> ****** 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.
>
-
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