EPrints Technical Mailing List Archive
Message: #03410
< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First
[EP-tech] Re: Writing slightly more complex searches
- To: "eprints-tech@ecs.soton.ac.uk" <eprints-tech@ecs.soton.ac.uk>
- Subject: [EP-tech] Re: Writing slightly more complex searches
- From: John Salter <J.Salter@leeds.ac.uk>
- Date: Fri, 22 Aug 2014 15:24:11 +0100
Or do (Friday afternoon monkey-code) $list1 = search1: userid = 42 $list2 = search2: (ispublished = 'pub' OR refereed = 'TRUE') $new_list = $list1->intersect( $list2 ); [From: http://wiki.eprints.org/w/API:EPrints/List] I'm guessing you're not on a Xapian-enabled repo..? Cheers, John -----Original Message----- From: eprints-tech-bounces@ecs.soton.ac.uk [mailto:eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Alan.Stiles Sent: 22 August 2014 14:58 To: eprints-tech@ecs.soton.ac.uk Subject: [EP-tech] Re: Writing slightly more complex searches Programmatically, could you do List1 = search (A and B) List 2 = search (A and C) ResultList = List 1 + List 2 Possibly slow and clunky though... Alan -----Original Message----- From: Ian Stuart [mailto:Ian.Stuart@ed.ac.uk] Sent: 22 August 2014 14:36 To: eprints Subject: [EP-tech] Writing slightly more complex searches Gentle-beings, wonder-folk, and those that lurk.... I'm trying to do search for A and (B or C) For example: search for userid=42 AND (ispublished = 'pub' OR refereed = 'TRUE') Now, before adding in the "OR" bit, setting up the search is simple: $dso = $session->get_repository->get_dataset('archive'); $searchexp1 = EPrints::Search->new( satisfy_all => 1, session => $session, dataset => $dso, ); $searchexp1->add_field( $dso->get_field('userid'), '42', ); $searchexp1->add_field( $dso->get_field('ispublished'), 'pub', 'EQ' ); .... but adding in referred causes a problem: $searchexp1->add_field( $dso->get_field('userid'), '42', ); $searchexp1->add_field( $dso->get_field('ispublished'), 'pub', 'EX' ); $searchexp1->add_field( $dso->get_field('refereed'), 'TRUE' ); (this is "A AND B AND C") Any tips? -- Ian Stuart. Developer: ORI, RJ-Broker, and OpenDepot.org Bibliographics and Multimedia Service Delivery team, EDINA, The University of Edinburgh. http://edina.ac.uk/ This email was sent via the University of Edinburgh. The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech *** Archive: http://www.eprints.org/tech.php/ *** EPrints community wiki: http://wiki.eprints.org/ *** EPrints developers Forum: http://forum.eprints.org/ -- The Open University is incorporated by Royal Charter (RC 000391), an exempt charity in England & Wales and a charity registered in Scotland (SC 038302). The Open University is authorised and regulated by the Financial Conduct Authority. *** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech *** Archive: http://www.eprints.org/tech.php/ *** EPrints community wiki: http://wiki.eprints.org/ *** EPrints developers Forum: http://forum.eprints.org/
- References:
- [EP-tech] Writing slightly more complex searches
- From: Ian Stuart <Ian.Stuart@ed.ac.uk>
- [EP-tech] Re: Writing slightly more complex searches
- From: "Alan.Stiles" <alan.stiles@open.ac.uk>
- [EP-tech] Writing slightly more complex searches
- Prev by Date: [EP-tech] Re: Writing slightly more complex searches
- Next by Date: [EP-tech] Re: Writing slightly more complex searches
- Previous by thread: [EP-tech] Re: Writing slightly more complex searches
- Next by thread: [EP-tech] Re: Writing slightly more complex searches
- Index(es):