Announcement

#1 2013-01-23 17:05:32

mcl
Member
2012-11-22
30

API pwg.images.search and an 'all terms option'

I have been using 'pwg.images.search' from the API quite successfully.

The result of this search seems to be the 'OR' option (ie any term matches a photo)

Is there some flag I need to set to make it return an 'AND' option (ie all terms match any photo) or do I have to filter the returned records in order to find only matching 'AND' records.

Thanks

mcl

Offline

 

#2 2013-01-23 19:47:03

flop25
Piwigo Team
2006-07-06
7037

Re: API pwg.images.search and an 'all terms option'

Hello
because of http://piwigo.org/dev/browser/trunk/inc … .php#L1278 and the AND like http://piwigo.org/dev/browser/trunk/inc … .php#L627, it will be always AND. According to the whole core it's better like that, so you will need to handle after


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

#3 2013-01-23 21:28:35

mcl
Member
2012-11-22
30

Re: API pwg.images.search and an 'all terms option'

Hi There,

Many thanks for the links.

Unfortunately my PHP is not really good enough to fully understand, but I think I get your meaning.

I am using piwigo.com, so I can not do any low level mods, but I am trying to create my own front-end to the photos with the API, because I can not get any existing theme to work as I would like.  My testing (early days)  seems to indicate that the API gives a pretty speedy return of READ calls, so i shall continue to try this option.

I will just have to do some post processing to filter non 'AND' results.  I am only interested in the Title and Comment fields, so it should not be too difficult.

Thanks again

mcl

Offline

 

#4 2013-01-24 12:12:31

rvelices
Former Piwigo Team
2005-12-29
1960

Re: API pwg.images.search and an 'all terms option'

this api uses the quick search method

it changed a bit in the current trunk version, but if you want to search for two terms A and B then use"+A +B" as a search term

Offline

 

#5 2013-01-24 17:24:56

mcl
Member
2012-11-22
30

Re: API pwg.images.search and an 'all terms option'

Thanks for the reply.

However I format a Quicksearch query or pwg.images.search, I do not seem to be able to make it work in an AND way.

+a +b seems to find either A or B, but not both and I could be wrong about this, but I get the feeling once it gets a match in a TAG it does not search Title and Description.

"+a +b" finds nothing, which would seem correct as it will be looking for the text string in quotes.

+"a b" finds nothing

I have run out of ideas - any advice appreciated.

Thanks

mcl

Offline

 

#6 2013-01-24 19:34:23

rvelices
Former Piwigo Team
2005-12-29
1960

Re: API pwg.images.search and an 'all terms option'

a link ? plus some terms you're trying to search ?

Offline

 

#7 2013-01-24 21:12:22

mcl
Member
2012-11-22
30

Re: API pwg.images.search and an 'all terms option'

Link:  http://whatcaristhat.piwigo.com/

If you use 'corvette' and 'burton', an AND search will show 3 matches, as proved by using the AND option of SEARCH, but with Quicksearch I can not duplicate with combinations of + and the terms

These are matched by values in the Title and Comment Field, although there are matches for Corvette in tags as well.

Thanks for your help

mcl

Offline

 

#8 2013-02-01 19:13:17

mcl
Member
2012-11-22
30

Re: API pwg.images.search and an 'all terms option'

Any thoughts as to how to get an `AND` query to work with either the API or Quicksearch in a standard theme ?

Thanks

Offline

 

#9 2013-02-12 21:47:49

mcl
Member
2012-11-22
30

Re: API pwg.images.search and an 'all terms option'

Do I assume from the non-reply that the API Search and the QuickSearch do not work as an AND search.

If this should work in an AND way, is it going to be fixed and will it be documented as to how it can be used.

Disappointed

mcl

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact