Marc Expert Search removes decimals when searching for specific tags

Bug #1039149 reported by Steve Callender
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
New
Undecided
Unassigned

Bug Description

I've tested this behavior in 2.0, 2.1 and 2.2.

When doing a Marc Expert Search, it appears that behind the scenes the decimals are being truncated.

For example, the normalization in the DB is converting decimals to spaces in metabib.real_full_rec.

Let's say tag 092 subfield a contains 123.456.789.

Normalization in the DB will convert it to "123 456 789"

-[ RECORD 1 ]+----------------------------
id | 1
record | 100
tag | 092
ind1 |
ind2 |
subfield | a
value | 123 456 789
index_vector | '123':3 '456':2 '789':1

When doing a Marc Expert Search from the Advanced Search screen (I've tested on both TPAC and JSPAC), using tag 092 and subfield a with a term of 123.456.789, it builds the link properly.

http://my.evergreen/opac/en-US/skin/default/xml/rresult.xml?rt=marc&d=0&l=1&ss=%5B%7B"term"%3A"123.456.789"%2C"restrict"%3A%5B%7B"tag"%3A"092"%2C"subfield"%3A"a"%7D%5D%7D%5D&adt=

The problem is caused after the call to search.biblio.marc,

open-ils.search open-ils.search.biblio.marc {"searches":[{"term":"123.456.789","restrict":[{"tag":"092","subfield":"a"}]}],"limit":200,"org_unit":1,"depth":0}, 10, 0

It looks like Application/Storage/Driver/Pg/fts.pm might just be cutting out the decimals rather than replacing them with spaces,

Here's part of the actual DB query from the above call,

 SELECT f.record, sum(f.sum), count(DISTINCT cp.id), sum(f.sum)
                 | FROM (SELECT x.record, sum(x.sum) FROM ((SELECT record, AVG(rank(index_vector, to_tsquery('default','123456789'))) as sum FROM metabib.full_rec WHERE ( tag = '092' AND subfield LIKE 'a' AND index_vector @@ to_tsquery('default','123456789') ) GROUP BY record)) x GROUP BY 1 HAVING COUNT(x.record) = 1 ORDER BY 2 DESC ) f,

So it's not finding the proper tags in the database.

Steve

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

Given the example DB query, I'm considering this one a duplicate of bug 965430.

summary: - Marc Export Search removes decimals when searching for specific tags
+ Marc Expert Search removes decimals when searching for specific tags
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.