EPrints Technical Mailing List Archive

Message: #03415


< 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


On 26/08/14 07:48, John Salter wrote:
Shouldn't you be trying:
$results = $results1->union($results2, 'eprintid');
D'Oh!!!

*facepalm*

?

________________________________________
From: eprints-tech-bounces@ecs.soton.ac.uk [eprints-tech-bounces@ecs.soton.ac.uk] On Behalf Of Ian Stuart [Ian.Stuart@ed.ac.uk]
Sent: 25 August 2014 10:19
To: eprints-tech@ecs.soton.ac.uk
Subject: [EP-tech] Re: Writing slightly more complex searches

Given these two searches:

    my $search1 = EPrints::Search->new(
      satisfy_all => 1,
      session     => $session,
      dataset     => $dso,
    );
    $search1->add_field( $dso->get_field("published"), 'pub', 'EQ' );
    my $results1 = $search1->perform_search;

    my $search2 = EPrints::Search->new(
      satisfy_all => 1,
      session     => $session,
      dataset     => $dso,
    );
    $search2->add_field( $dso->get_field("refereed"), 'TRUE' );
    my $results2 = $search2->perform_search;

    my $results = $search1->union($search2, 'eprintid');

Why am I getting the error

    Can't locate object method "union" via package "EPrints::Search" at...

when I run the script?

(Eprints 3.3.12 and referring to
http://wiki.eprints.org/w/API:EPrints/Search and
http://wiki.eprints.org/w/API:EPrints/List )

--

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/
*** 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/



--

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.