Re: Announce: Database 'search' Function

2023-11-07 Thread Alexander Burger
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


Re: Announce: Database 'search' Function

2023-11-07 Thread Abraham Palmer
I see how I can 'and' criteria together, but can I 'or'? 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?
--Abraham

On Wed, Oct 25, 2023 at 9:14 AM Alexander Burger 
wrote:

> Hi all,
>
> since version 23.10.23 PicoLisp has a new 'search' function. It allows to
> search
> the database for a combination of search criteria:
>
>https://software-lab.de/doc/search.html
>
>
> 'search' provides the same functionality as the Pilog 'select/3' predicate
>
>https://software-lab.de/doc/select.html
>
> but is much simpler to use, two to three times faster, and more general.
>
>
> It is recommended to use 'search' instead of 'select/3' for new projects.
> In the
> long term, 'select/3' will be deprecated.
>
>
> I have already replaced 'select/3' and the other Pilog database predicates
> in
> public projects:
>
>
> -- The PicoLisp tutorial
>
>   https://software-lab.de/tut.tgz
>
>Relevant here is the "family" application
>
>
> -- Demo app
>
>   https://software-lab.de/demoApp.tgz
>
>Online at https://picolisp.com/app
>
>The old version is still available for comparisons in
>https://software-lab.de/demoApp.pilog.tgz
>
>
> -- PicoLisp Wiki
>
>   https://software-lab.de/wiki.tgz
>
>Online at https://picolisp.com/wiki
>
>
> -- Open StreetMap demo
>
>   https://software-lab.de/osm.tgz
>
>Described in https://picolisp.com/wiki/?osmgeodata
>Online at https://picolisp.com/osm
>
> I hope that 'search' turns out to be useful.
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


-- 
http://boxturtlebakery.com
(919)357-6034
abra...@boxturtlebakery.com


Re: Announce: Database 'search' Function

2023-10-25 Thread Alexander Burger
On Wed, Oct 25, 2023 at 09:57:52AM -0700, wayne horner wrote:
> the demo app requires a login

Oh, sorry! This was communicated a long time ago ;)

User is admin, password is admin


For tho OSM demo, user is osm and password is osm

☺/ A!ex

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


Re: Announce: Database 'search' Function

2023-10-25 Thread wayne horner
the demo app requires a login

but there is no link to create an account.

Alandata Data Recovery -  (949)287-3282
"Cleanroom Data Recovery of RAID, VMware, Network Attached Storage, Linux,
Tape, Disk, Forensics"
*www.AlanData.com    www.AlanDataRecovery.com
*


On Wed, Oct 25, 2023 at 7:51 AM Alexander Burger 
wrote:

> Hi Christos,
>
> > I did notice a small spelling error in the documentation of search,
> > namely the word "referst".
>
> Ah, cool, thank you! I fixed it.
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>


Re: Announce: Database 'search' Function

2023-10-25 Thread Alexander Burger
Hi Christos,

> I did notice a small spelling error in the documentation of search,
> namely the word "referst".

Ah, cool, thank you! I fixed it.

☺/ A!ex

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


Re: Announce: Database 'search' Function

2023-10-25 Thread Christos Gitsis
Hi Alex,

thank you for this new feature, it really looks simpler than the previous
way. I did notice a small spelling error in the documentation of search,
namely the word "referst".

Regards,
Christos Gitsis

Στις Τετ 25 Οκτ 2023 στις 3:13 μ.μ., ο/η Alexander Burger <
picolisp@software-lab.de> έγραψε:

> Hi all,
>
> since version 23.10.23 PicoLisp has a new 'search' function. It allows to
> search
> the database for a combination of search criteria:
>
>https://software-lab.de/doc/search.html
>
>
> 'search' provides the same functionality as the Pilog 'select/3' predicate
>
>https://software-lab.de/doc/select.html
>
> but is much simpler to use, two to three times faster, and more general.
>
>
> It is recommended to use 'search' instead of 'select/3' for new projects.
> In the
> long term, 'select/3' will be deprecated.
>
>
> I have already replaced 'select/3' and the other Pilog database predicates
> in
> public projects:
>
>
> -- The PicoLisp tutorial
>
>   https://software-lab.de/tut.tgz
>
>Relevant here is the "family" application
>
>
> -- Demo app
>
>   https://software-lab.de/demoApp.tgz
>
>Online at https://picolisp.com/app
>
>The old version is still available for comparisons in
>https://software-lab.de/demoApp.pilog.tgz
>
>
> -- PicoLisp Wiki
>
>   https://software-lab.de/wiki.tgz
>
>Online at https://picolisp.com/wiki
>
>
> -- Open StreetMap demo
>
>   https://software-lab.de/osm.tgz
>
>Described in https://picolisp.com/wiki/?osmgeodata
>Online at https://picolisp.com/osm
>
> I hope that 'search' turns out to be useful.
>
> ☺/ A!ex
>
> --
> UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
>