Looks like the problem is coming from the getMoreLikeThis() method in sys/Solr.php.  This is an RC1-specific problem, since the newer trunk code gets similar items using built-in Solr behavior.

 

For now, this might serve as a quick fix:

 

Change this code (around line 150 in the unmodified RC1 code):

 

        if (isset($record['callnumber-label'])) {

            $query .= ' OR callnumber-label:(' . $record['callnumber-label'] . ')^200';

        }

 

To:

 

        if (isset($record['callnumber-label'])) {

            $query .= ' OR callnumber-label:("' . $record['callnumber-label'] . '")^200';

        }

 

(I just added double quotes inside the parentheses of the callnumber-label clause).

 

I haven't tested this, but I think it should solve the problem of searching for a reserved keyword in an inappropriate context.

 

If you want to get rid of the NOTs in your index entirely in addition to preventing them from breaking code, you could probably add a pattern map to your marc.properties file to specifically exclude NOT from being indexed as a callnumber-label… though you would have to do a full reindex before it would take effect.

 

- Demian

 

From: M.Fake@lse.ac.uk [mailto:M.Fake@lse.ac.uk]
Sent: Wednesday, September 30, 2009 8:19 AM
To: kinstler@gmail.com
Cc: vufind-general@lists.sourceforge.net
Subject: Re: [VuFind-General] NOT in the 090 field

 

Sorry, should have included that!

 

The debugging (on our test machine) says:

 

Get Record: 690104
GET: http://localhost:8080/solr/biblio/select/?q=id%3A690104
Query: (title:(Fortitude the DDay deception campaign)^75 OR title_short:(Fortitude)^100 OR callnumber-label:(NOT)^200 OR fulltopic:("Operation Overlord.")^300 OR fulltopic:(Operation Overlord.)^250 OR fulltopic:("World War, 1939-1945 Campaigns France Normandy.")^300 OR fulltopic:(World War, 1939-1945 Campaigns France Normandy.)^250 OR language:(English)^30 OR author:("Hesketh, Roger Fleetwood 1902-1987")^75) NOT id:(690104)
FilterQuery:  *:*
POST: http://localhost:8080/solr/biblio/select/?
q=(title:(Fortitude the DDay deception campaign)^75 OR title_short:(Fortitude)^100 OR callnumber-label:(NOT)^200 OR fulltopic:("Operation Overlord.")^300 OR fulltopic:(Operation Overlord.)^250 OR fulltopic:("World War, 1939-1945 Campaigns France Normandy.")^300 OR fulltopic:(World War, 1939-1945 Campaigns France Normandy.)^250 OR language:(English)^30 OR author:("Hesketh, Roger Fleetwood 1902-1987")^75) NOT id:(690104)
rows=5
start=
indent=yes
fl=*,score
fq=*:*

 

The error page displays

Unable to process query
Solr Returned:

[576] /usr/local/lib/php/PEAR.php
[766] /usr/local/vufind/web/sys/Solr.php
[752] /usr/local/vufind/web/sys/Solr.php
[521] /usr/local/vufind/web/sys/Solr.php
[183] /usr/local/vufind/web/sys/Solr.php
[133] /usr/local/vufind/web/services/Record/Record.php
[115] /usr/local/vufind/web/index.php

 

 


From: Till Kinstler [mailto:kinstler@gmail.com]
Sent: 30 September 2009 13:05
To: Fake,M
Cc: vufind-general@lists.sourceforge.net
Subject: Re: [VuFind-General] NOT in the 090 field

 

On Wed, Sep 30, 2009 at 8:14 PM, <M.Fake@lse.ac.uk> wrote:

Dear all,

A curious one this. We've just discovered that some records are causing
php errors when we try and go to the record view, and the cause seems to
be the word 'NOT' in the 090 field.


What's the exact PHP error message? 

Till


Please access the attached hyperlink for an important electronic communications disclaimer: http://www.lse.ac.uk/collections/secretariat/legal/disclaimer.htm