Comment 7 for bug 1806724

Revision history for this message
Martha Driscoll (mjdriscoll) wrote :

NOBLE's fix for both highlighting search terms and avoiding double subject headings is to change search.best_tsconfig to get ts_config's with a weight of 'A' which points to the non-stemmed simple indexes. The custom dictionary is still weight 'C' so not producing duplicates anymore. Highlighting is working for the dictionary words although I'm not sure why. A search for 'no. nine' highlights 'no. 9'. (nine and 9 are in the synonym list).

Obviously not a fix for most of the community who uses the stemmed indexes, but I hope there is a way to accommodate custom dictionaries.

search.best_tsconfig:
SELECT m.id,
    COALESCE(f.ts_config, c.ts_config, 'simple'::text) AS ts_config
   FROM config.metabib_field m
     LEFT JOIN config.metabib_class_ts_map c ON c.field_class = m.field_class AND c.index_weight = 'A'::bpchar
     LEFT JOIN config.metabib_field_ts_map f ON f.metabib_field = m.id AND f.index_weight = 'A'::bpchar;

config.metabib_class_ts_map:
id field_class ts_config active index_weight
2 keyword english_nostop f C
10 subject english_nostop f C
8 series english_nostop f C
4 title english_nostop f C
6 author english_nostop f C
11 identifier simple t A
1 keyword simple t A
3 title simple t A
5 author simple t A
7 series simple t A
9 subject simple t A
13 title synonym_noble t C
14 subject synonym_noble t C
12 keyword synonym_noble t C