Skip to content

Commit 186eb13

Browse files
authored
Merge pull request #20 from super-reality/EET-48
Fixed search API used in search documents
2 parents f00cab1 + e8802bc commit 186eb13

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

server/src/systems/searchCorpus.ts

+2-6
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)