OR operator in Omeka-S searches

20 views
Skip to first unread message

Franck Dupont

unread,
Feb 21, 2017, 6:05:07 AM2/21/17
to Omeka Dev
Hello,

Omeka-S provides the ability to search by values, but when you add new values in criterias, the operator seems to be "AND".

For example, if "myterm" appears in DC:Title (property #1) and DC:Abstract (property #19) is empty, the search return no results.


Extract of $params array to illustrate what I mean :
[property] => Array
(
   
[1] => Array
       
(
           
[in] => Array
               
(
                   
[0] => myterm
               
)
       
)

   
[19] => Array
       
(
           
[in] => Array
               
(
                   
[0] => myterm
               
)
       
)
)


Is there a way to obtain results for "OR" operator ("myterm" in DC:Title OR in DC:Abstract ) ?

Thanks.

Franck.

John Flatness

unread,
Feb 21, 2017, 3:21:24 PM2/21/17
to Omeka Dev
You're correct, the different search criteria are "ANDed" together. It's pretty much baked into how the search works, so as an end-user or consumer of the internal or external API, there's not much you can do about it. This is in line with how Omeka Classic always historically worked.

Now, as of very recently, Classic has added the ability for users to choose between "AND" and "OR" for search criteria. We haven't ported this over to S yet, but it's something being considered. One complicating factor is that S actually moved around the structure of the search parameters in such a way that makes it a little more difficult to add AND/OR support.
Reply all
Reply to author
Forward
0 new messages