Ignore:
Timestamp:
2013-08-01T15:17:17+12:00 (11 years ago)
Author:
kjdon
Message:

check that we actually have stem/case/accentfold before setting them - if we set accentfold to true and we have no accent fold, its trying to open a stem index that doesn't exist, and then you get no stemming or case folding at all

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2MGPPSearch.java

    r26352 r27950  
    101101        mgpp_src.setQueryLevel(this.default_level);
    102102        // we have case folding on by default
    103         mgpp_src.setCase(case_default.equals(BOOLEAN_PARAM_ON) ? true : false);
    104         mgpp_src.setStem(stem_default.equals(BOOLEAN_PARAM_ON) ? true : false);
    105         mgpp_src.setAccentFold(accent_default.equals(BOOLEAN_PARAM_ON) ? true : false);
    106 
     103        if (this.does_case) {
     104          mgpp_src.setCase(case_default.equals(BOOLEAN_PARAM_ON) ? true : false);
     105        }
     106        if (this.does_stem) {
     107          mgpp_src.setStem(stem_default.equals(BOOLEAN_PARAM_ON) ? true : false);
     108        }
     109        if (this.does_accent) {
     110          mgpp_src.setAccentFold(accent_default.equals(BOOLEAN_PARAM_ON) ? true : false);
     111        }
    107112        // set up the query params
    108113        Set entries = params.entrySet();
     
    117122            String value = (String) m.getValue();
    118123
    119             if (name.equals(CASE_PARAM))
     124            if (name.equals(CASE_PARAM) && this.does_case)
    120125            {
    121126                boolean val = (value.equals(BOOLEAN_PARAM_ON) ? true : false);
    122127                mgpp_src.setCase(val);
    123128            }
    124             else if (name.equals(STEM_PARAM))
     129            else if (name.equals(STEM_PARAM) && this.does_stem)
    125130            {
    126131                boolean val = (value.equals(BOOLEAN_PARAM_ON) ? true : false);
    127132                mgpp_src.setStem(val);
    128133            }
    129             else if (name.equals(ACCENT_PARAM))
     134            else if (name.equals(ACCENT_PARAM) && this.does_accent)
    130135            {
    131136                boolean val = (value.equals(BOOLEAN_PARAM_ON) ? true : false);
Note: See TracChangeset for help on using the changeset viewer.