Hi Abraham,

> I see how I can 'and' criteria together, but can I 'or'?

Yes, but you need to supply Custom Generator and Filter functions.

The documentation has an example for this in "Multiple Indexes", where a
telephone number being searched for may be in the landline *OR* in the mobile
index. The example uses the existing 'relQs' function which in turn generates
the necessary generator and filter functions.


> For instance I
> have a search for items where I want to return all of them that have a link
> to 1 or more tags in a list. Right now I was running the search for each of
> my tags and using 'push1' to get the desired results. Is there a better way?

Perhaps, but it is a bit tedious to supply the proper functions.

What are the "tags" in your case? As you talk about "link"s, I assume they are
(+Ref +Link)s to other objects.

If so, if we take itams and supuliers from the demo app, then items can be
searched by suppliers. Let's assume we have a list of 2 suppliers ({C1} {C2}),
we can search for their items with:

 (for
   (Q
      (search
         '({C1} {C2})  # List of suppliers
         (quote
            ((X) (cons (list X) pop))  # Generator
            ((X Val) (memq X Val))  # Filter
            (sup +Item) ) )  # Association to item by 'sup' index
      (search Q) )
   (show @) )

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to