MCPcopy Create free account
hub / github.com/CommE2E/comm / processQueryForSearch

Function processQueryForSearch

keyserver/src/database/search-utils.js:165–180  ·  view source on GitHub ↗
(query: string)

Source from the content-addressed store, hash-verified

163const fulltextOperands = ['+', '<', '>', '~'];
164
165function 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
182export {
183 processMessagesForSearch,

Callers 2

Calls 1

segmentAndStemFunction · 0.85

Tested by

no test coverage detected