EPrints Technical Mailing List Archive

Message: #00929


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Re: Searching in EP3.2


On 08/08/12 14:35, Tim Brody wrote:
On Wed, 2012-08-08 at 13:57 +0100, Ian Stuart wrote:
On 08/08/12 12:33, Tim Brody wrote:
On Wed, 2012-08-08 at 11:14 +0100, Ian Stuart wrote:
Confused here.... I'm trying to restrict a search, and it's returning 0
results when it should return 19:

     $searchexp2->add_field($dsd->get_field("field3"), 'Foo bar');

Does that need an EQ ANY?

It's a single match on a 7-character string...

For example, this could be

    $searchexp2->add_field($dsd->get_field("creator_institution"),
'University of Southampton');

I would expect this to be a singular, complete, match....


Then 'EX' ? Otherwise that may (depending on the field) default to 'EQ
ALL' (=University AND =of AND =Southampton ...).

Nope.

This is the actual, in-code, add_field
  $searchexp2->add_field( $dso->get_field( "provenance" ),
                          'Nature Publishing Group',
                          'EQ',
                          'ANY');


If it is in.... I get  0 results,
If it is out... I get 19 results.

If I look in the code that creates the record, it has 'Nature Publishing Group', and if I look in the actual database, it has "Nature Publishing Group" (sans quotes)

After much experimenting with EQ/EX/IN and ANY/ALL, I find I need

  $searchexp2->add_field( $dso->get_field( "provenance" ),
                          'Nature Publishing Group',
                          'EX',
                          'ALL');

More documentation (and especially examples!) need on the wiki :D

--

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.