Skip to content

Commit e8802bc

Browse files
committed
Fixed search API used in search documents
1 parent bce20d8 commit e8802bc

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

server/src/systems/searchCorpus.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,8 @@ export async function initSearchCorpus(ignoreDotEnv: boolean) {
118118

119119
return (ctx.body = 'ok')
120120
})
121-
router.post('/search', async function (ctx: Koa.Context) {
122-
const agent = ctx.request.body?.agent
123-
const question = ctx.request.body?.question as string
124-
const sameTopicOnly =
125-
(ctx.request.body?.sameTopicOnly as string).toLowerCase().trim() ===
126-
'true'
121+
router.get('/search', async function (ctx: Koa.Context) {
122+
const question = ctx.request.query?.question as string
127123
const cleanQuestion = removePanctuationalMarks(question)
128124
const words = simplifyWords(cleanQuestion.split(' '))
129125
const topic = await classifyText(question)

0 commit comments

Comments
 (0)