Z39.50 Native Catalog Search Problems

Bug #1170036 reported by Jason Stephenson
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
High
Unassigned
2.4
Fix Released
High
Unassigned

Bug Description

Evergreen Version: master && 2.4-beta
OpenSRF Version: master (but not an OpenSRF issue)
PostgreSQL Version: 9.1.6 && 9.2.3 && 9.2.4 (don't think Postgres has much to do with it)

We upgraded to master in production this past weekend and since then Z39.50 local catalog search has not been working.

The symptoms are as follows:

Try a Z39.50 search and check the box to include the native/local Evergreen catalog. The search fails and staff will get a network failure with something like so:

method=open-ils.search.z3950.search_class
params=["a736c060829bf7f5ca8d61f1a7b764ef",{"service_array":["native-evergreen-catalog","cwmars","loc","noble"],"username_array":["","","",""],"password_array":["","","",""],"limit":3,"offset":0,"search":{"isbn":"9781250004727"},"service":["native-evergreen-catalog","cwmars","loc","noble"],"username":["","","",""],"password":["","","",""]}]
THROWN:
{"fileName":"oils://remote/js/dojo/dojo/dojo.js","lineNumber":31}
STATUS:

The Apache error log has the following:

[Wed Apr 17 12:23:02 2013] [info] [client 134.241.121.11] OpenSRF JSON Request r
eturned error: osrfMethodException -> *** Call to [open-ils.search.z3950.search
_class] failed for session [1366215782.778572.13662157828681], thread trace [1]:
\nException: OpenSRF::EX::ERROR 2013-04-17T12:23:02 OpenSRF::Application /usr/lo
cal/share/perl/5.14.2/OpenSRF/Application.pm:233 System ERROR: Call to open-ils.
storage for method open-ils.storage.biblio.multiclass.search_fts.staff.atomic \n
 failed with exception: Exception: OpenSRF::EX::ERROR 2013-04-17T12:23:02 OpenIL
S::Application::AppUtils /usr/local/share/perl/5.14.2/OpenILS/Application/AppUti
ls.pm:200 System ERROR: Exception: OpenSRF::DomainObject::oilsMethodException 20
13-04-17T12:23:02 OpenSRF::AppRequest /usr/local/share/perl/5.14.2/OpenSRF/AppSe
ssion.pm:1064 <500> *** Call to [open-ils.storage.biblio.multiclass.search_fts
.staff.atomic] failed for session [1366215782.800854944.11686704585], thread tra
ce [1]:\nDBD::Pg::db selectall_arrayref failed: ERROR: text search configuratio
n "identifier" does not exist\nLINE 4: ...(ts_rank(identifier_isbn.index_vector,
 to_tsquery('identifie...\n
        ^ [for Statement "\n\t\t\tSELECT\ts.*\n\t\t\t FROM\t(\t\tSELECT\tb.id,\n\t\t\tAVG( (ts_rank(identifier_isbn.index_vector, to_tsquery('identifier','9781250004727')) * (SELECT weight FROM config.metabib_field WHERE identifier_isbn.field = id)) * (1) ) AS rel,\n\t\t\tAVG( (ts_rank(identifier_isbn.index_vector, to_tsquery('identifier','9781250004727')) * (SELECT weight FROM config.metabib_field WHERE identifier_isbn.field = id)) * (1) ) AS rank,\n\t\t\tb.source\n \t \tFROM\tmetabib.identifier_field_entry identifier_isbn, \n\t\t\tmetabib.rec_descriptor rd,\n\t\t\tconfig.bib_source src,\n\t\t\tbiblio.record_entry b\n\t \tWHERE\trd.record = b.id\n\t\t\tAND b.active IS TRUE\n\t\t\tAND b.deleted IS FALSE\n\t\t\t AND identifier_isbn.index_vector @@ to_tsquery('identifier','9781250004727') AND b.id = identifier_isbn.source AND identifier_isbn.field = 18\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n \t \tGROUP BY b.id, b.source\n \t \tORDER BY 3 DESC\n\t\tLIMIT 5000\n) s\n\t\t\t \tLEFT OUTER JOIN config.bib_source src ON (s.source = src.id)\n\t\t\t WHERE\tEXISTS (\n\t\t\t \tSELECT\t1\n\t\t\t\t FROM\tasset.call_number cn,\n\t\t\t\t\tasset.copy cp,\n\t\t\t\t\tactor.org_unit_descendants(1) d\n\t\t\t\t WHERE\tcn.record = s.id\n\t\t\t\t\tAND cp.call_number = cn.id\n\t\t\t\t\tAND cn.deleted IS FALSE\n\t\t\t\t\tAND cp.circ_lib = d.id\n\t\t\t\t\tAND cp.deleted IS FALSE\n\t\t\t\t\t\n\t\t\t\t LIMIT 1\n\t\t\t\t)\n\t\t\t\tOR NOT EXISTS (\n\t\t\t\tSELECT\t1\n\t\t\t\t FROM\tasset.call_number cn\n\t\t\t\t WHERE\tcn.record = s.id\n\t\t\t\t LIMIT 1\n\t\t\t\t)\n\t\t\t\tOR src.transcendant IS TRUE\n\t\t\t ORDER BY 3 DESC\n"] at /usr/local/share/perl/5.14.2/OpenILS/Application/Storage/Publisher/metabib.pm line 2364.\n\n\n\n : \n\n

The PG log contains the following:

2013-04-17 12:22:04 EDT ERROR: text search configuration "identifier" does not exist at character 100
2013-04-17 12:22:04 EDT STATEMENT:
                                SELECT s.*
                                  FROM ( SELECT b.id,
                                AVG( (ts_rank(identifier_isbn.index_vector, to_tsquery('identifier','9781250004727')) * (SELECT weight FROM config.metabib_field WHERE identifier_isbn.field = id)) * (1) ) AS rel,
                                AVG( (ts_rank(identifier_isbn.index_vector, to_tsquery('identifier','9781250004727')) * (SELECT weight FROM config.metabib_field WHERE identifier_isbn.field = id)) * (1) ) AS rank,
                                b.source
                        FROM metabib.identifier_field_entry identifier_isbn,
                                metabib.rec_descriptor rd,
                                config.bib_source src,
                                biblio.record_entry b
                        WHERE rd.record = b.id
                                AND b.active IS TRUE
                                AND b.deleted IS FALSE
                                 AND identifier_isbn.index_vector @@ to_tsquery('identifier','9781250004727') AND b.id = identifier_isbn.source AND identifier_i
sbn.field = 18

                        GROUP BY b.id, b.source
                        ORDER BY 3 DESC
                        LIMIT 5000
        ) s
                                        LEFT OUTER JOIN config.bib_source src ON (s.source = src.id)
                                  WHERE EXISTS (
                                        SELECT 1
                                          FROM asset.call_number cn,
                                                asset.copy cp,
                                                actor.org_unit_descendants(1) d
                                          WHERE cn.record = s.id
                                                AND cp.call_number = cn.id
                                        SELECT 1
                                          FROM asset.call_number cn,
                                                asset.copy cp,
                                                actor.org_unit_descendants(1) d
                                          WHERE cn.record = s.id
                                                AND cp.call_number = cn.id
                                                AND cn.deleted IS FALSE
                                                AND cp.circ_lib = d.id
                                                AND cp.deleted IS FALSE

                                          LIMIT 1
                                        )
                                        OR NOT EXISTS (
                                        SELECT 1
                                          FROM asset.call_number cn
                                          WHERE cn.record = s.id
                                          LIMIT 1
                                        )
                                        OR src.transcendant IS TRUE
                                  ORDER BY 3 DESC

If you don't search the local catalog, then z39.50 search works just fine.

Revision history for this message
Jason Stephenson (jstephenson) wrote :

Should have mentioned that the above happens in the staff client.

tags: added: staffclient
Revision history for this message
Mike Rylander (mrylander) wrote :

This branch encapsulates the changes required to address this short-term. A variant has been tested by Jason Stephenson, but more eyes are always better.

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/collab/miker/reinstate-tsconfigs

Changed in evergreen:
importance: Undecided → High
tags: added: pullrequest
removed: staffclient
Revision history for this message
Jason Stephenson (jstephenson) wrote :

Resolves the problem for me. I've stamped the upgrade script and pushed to master.

Thanks for everything, Mike!

Jason

Changed in evergreen:
status: New → Fix Committed
Revision history for this message
Mark Cooper (markchristophercooper) wrote :

Can confirm this did the trick for me too. So that push looks good.

Mark

Ben Shum (bshum)
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.