Changeset 10954
- Timestamp:
- 2005-11-28T16:53:56+13:00 (18 years ago)
- Location:
- trunk/gsdl/src/colservr
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/colservr/mgppqueryfilter.cpp
r9937 r10954 78 78 text_tarray options; 79 79 indexfieldmap.gettoarray (options); 80 filterOptions["IndexField"].validValues.erase(filterOptions["IndexField"].validValues.begin(), filterOptions["IndexField"].validValues.end()); 81 text_tarray::const_iterator here = options.begin(); 82 text_tarray::const_iterator end = options.end(); 83 bool start = true; 84 while (here !=end) { 85 if (!(*here).empty()) { 86 filterOptions["IndexField"].validValues.push_back(*here); 87 if (start) { 88 filterOptions["IndexField"].defaultValue = *here; 89 start = false; 90 } 91 } 92 ++here; 93 } 80 filterOptions["IndexField"].validValues = options; 94 81 95 82 } else if (key == "indexlevels") { … … 113 100 } else if (key == "indexstem") { 114 101 ((mgppsearchclass *)textsearchptr)->set_indexstem (cfgline[0]); 115 } 116 117 } 118 102 } else if (key == "defaultindex") { // used for fields in mgpp 103 indexfieldmap.from2to (cfgline[0], filterOptions["IndexField"].defaultValue); 104 } 105 106 } 107 108 bool mgppqueryfilterclass::init (ostream &logout) { 109 110 if (!queryfilterclass::init(logout)) { 111 return false; 112 } 113 114 if (filterOptions["IndexField"].defaultValue.empty()) { 115 // use first index in map as default if no default is set explicitly 116 text_tarray fromarray; 117 indexfieldmap.getfromarray(fromarray); 118 if (fromarray.size()) { 119 filterOptions["IndexField"].defaultValue = fromarray[0]; 120 } 121 } 122 return true; 123 } 119 124 120 125 void mgppqueryfilterclass::filter(const FilterRequest_t &request, -
trunk/gsdl/src/colservr/mgppqueryfilter.h
r1835 r10954 50 50 51 51 void configure (const text_t &key, const text_tarray &cfgline); 52 52 bool init (ostream &logout); 53 53 void filter (const FilterRequest_t &request, 54 54 FilterResponse_t &response, -
trunk/gsdl/src/colservr/queryfilter.h
r9937 r10954 78 78 79 79 virtual void configure (const text_t &key, const text_tarray &cfgline); 80 bool init (ostream &logout);80 virtual bool init (ostream &logout); 81 81 82 82 text_t get_filter_name () {return "QueryFilter";}
Note:
See TracChangeset
for help on using the changeset viewer.