MiniVend Akopia Services

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

coordinated dic-search



******    message to minivend-users from Thomas Walter <tw@mail.itreff.de>     ******

Hiho again... ;-)

I have a products.asc-file containing the usual stuff plus a category
and a subcategory field.
To speed up searching I use the binary search (dictionary-files are
created with Database INDEX) for both fields.

Now two questions I had in the last 20 minutes assuming the above
setup...

1.
How do I search for items that are in subcategory X of category Y using
the binary search (using the normal search works: [area scan
sf=category/se=Y/sf=subcategory/se=X]).
But if I try to do this with the binary search it does not...

2.
I use the following code to generate an index on every page:

<!-- iterate over all catgories-->
[loop search="di=category"]
  [loop-change category][condition][loop-field category][/condition]
    <a href="[area scan di=category/dl=[loop-field
category]]">[loop-field category]</a><br>

    <!-- iterate over all subcategories of one category if this was
searched for -->
    [if value mv_searchspec eq [loop-field category]]
      [loop with="-2" search="di=subcategory
                              di=category
                              dl=[loop-field category]"]
        [loop-change-2 subcategory][condition][loop-field-2
subcategory][/condition]
          <a href="[area scan sf=category
                              se=[loop-field category]
                              sf=subcategory
                              se=[loop-field-2 subcategory]]">
            [loop-field-2 subcategory]</a><br>
        [/loop-change-2 subcategory]
      [/loop]
    [/if]
  [/loop-change category]
[/loop]

The purpose of this code is to first create an index of all categories.
If the user chooses one of the categories it displays the category-index
plus the subcategories of this category.
This works fine until I choose a subcategory-search-link. Than the
subcategories are not displayed anymore. I thought this is because
mv_searchspec is not equal to the category name anymore, because of two
searchspecs. But printing it with [value mv_searchspec] looks like it
_is_ the category? 

Another way to do this are scratch-variables, I think... but I don&#180;t
know how to do this by now..

Whow this is hard to describe in English - I hope someone does
understand me...

     Balu

PS: I know that this is absolutely not the way you should create an
index, because it loops and loops on every new created page, but... ;-)
PPS: Other suggestions how to do this?
-
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: