(query: string)
| 163 | const fulltextOperands = ['+', '<', '>', '~']; |
| 164 | |
| 165 | function processQueryForSearch(query: string): string { |
| 166 | if (query === '') { |
| 167 | return ''; |
| 168 | } |
| 169 | const stemmedQuery = segmentAndStem(query); |
| 170 | |
| 171 | if (stemmedQuery === '') { |
| 172 | return ''; |
| 173 | } |
| 174 | |
| 175 | return stemmedQuery |
| 176 | .split(' ') |
| 177 | .filter(word => !fulltextOperands.includes(word)) |
| 178 | .map(segment => `+${segment}`) |
| 179 | .join(' '); |
| 180 | } |
| 181 | |
| 182 | export { |
| 183 | processMessagesForSearch, |
no test coverage detected