view · edit · sidebar · attach · print · history

20130316-debug-doctor-index-creation-and-hpc-recall-rss

<< | Index | >>


Summary

  • Create INDEX with simple dictionary for doctor, hospital, indication.
  • Debug creation with current production data.

Commits

Index


Debug doctor INDEX creation

on Production Server.
PostgreSQL on Prodection does not have default Dictionary.

@4000000051444e320a67c3d4 ODBA::Storage.retrieve_from_fulltext_index
rescued a DBI::ProgrammingError(FEHLER:  Textsuchekonfiguration
»default« existiert nicht
@4000000051444e320a67c7bc ). Query:
@4000000051444e320a682d4c self.dbi.select_all(
 SELECT target_id,
@4000000051444e320a682d4c
max(ts_rank(search_term, to_tsquery(?, ?))) AS relevance
@4000000051444e320a683134                               FROM hospital_index
@4000000051444e320a683134                               WHERE
search_term @@ to_tsquery(?, ?)
@4000000051444e320a683134                               GROUP BY target_id
@4000000051444e320a68351c                               ORDER BY relevance DESC
@4000000051444e320a68351c , default, Bern, default, Bern)
@4000000051444e320a688b0c returning empty result
@4000000051444e4223124f44 FEHLER:  Textsuchekonfiguration »default«
existiert nicht
@4000000051444e4223125714

use simple instead of default for following indices.

  • doctor_index
  • indication_index (indication_index_de uses default_german.)
  • hospital_index
oddb.org.ruby193=# select * from ts_debug('simple', 'Yasuhiro Asaka');
   alias   |   description   |  token   | dictionaries | dictionary |  lexemes   
-----------+-----------------+----------+--------------+------------+------------
 asciiword | Word, all ASCII | Yasuhiro | {simple}     | simple     | {yasuhiro}
 blank     | Space symbols   |          | {}           |            | 
 asciiword | Word, all ASCII | Asaka    | {simple}     | simple     | {asaka}
(3 rows)

And debg with current production data.

ch.oddb> rebuild_indices 'doctor_index'

dropping: doctor_index
creating: doctor_index
filling: doctor_index
@doctors.values
source.size: 34663
finished in 9.02393557725 min
all Indices Created in total: 0.15040288420166667 h

in src/util/oddbapp.rb

def search_doctors(key)
  ODBA.cache.retrieve_from_index("doctor_index", key) 
end

Chekc via psql

oddb.org.ruby193=# \d doctor_index;
    Table "public.doctor_index"
   Column    |   Type   | Modifiers 
-------------+----------+-----------
 origin_id   | integer  | 
 search_term | tsvector | 
 target_id   | integer  | 
Indexes:
    "origin_id_doctor_index" btree (origin_id)
    "search_term_doctor_index" gist (search_term)
    "target_id_doctor_index" btree (target_id)

oddb.org.ruby193=# select search_term from doctor_index limit 3;
                                                                                                               search_term                                                                                                               
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 '7601000210319':6 'arbenz':1 'innere':3 'kardiologie':5 'medizin':4 'urs':2
 '055':14,18 '11':17 '16':21 '51':16,20 '653':15,19 '7601000549709':9 '8784':12,23 'braunwald':11,13,22 'medizin':6 'peter':3 'physikalische':5 'pschnorrrehaclinicch':4 'ralf':2 'rehabilitation':8 'rehaclinic':10 'schnorr':1 'und':7
 '031':16 '11':19 '22':18 '3011':14,21 '382':17 '6':13 '7601000081407':7 'arztpraxis':11 'bern':15,20 'christina':3,8 'dill':1,9 'gutenbergstr':12 'psychiatrie':4 'psychotherapie':6 'richner':2,10 'und':5
(3 rows)
commit

Debug HPC and recall RSS

  • update_swissmedic_feeds
    • update_recall_feed
    • update_hpc_feed
ch.oddb> rss_updates.keys
-> ["minifi.rss", "fachinfo.rss", "feedback.rss", "price_cut.rss", "price_rise.rss", "sl_introduction.rss", "recall.rss", "hpc.rss"]
ch.oddb> rss_updates['recall.rss']
-> [#<Date: 2012-11-22 ((2456254j,0s,0n),+0s,2299161j)>, 3]

Bug of extract_swissmedic_entry_from()

[8] 1.9.3-p194(#<ODDB::RssPlugin>)> "(\d{2})\.(#{@@today.month})\.(#{@@today.year})"
=> "(d{2}).(3).(2013)"
[9] 1.9.3-p194(#<ODDB::RssPlugin>)> @@today.month
=> 3

fixed this bug.

commit
view · edit · sidebar · attach · print · history
Page last modified on March 18, 2013, at 03:31 PM