blob: 4c01765cddd7d8be4416461651d8e7a40404852c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import axios from 'axios'
export default async function handler(req, res) {
const { q = '' } = req.query
let result = await axios(
process.env.SOLR_HOST + `/solr/product/spell?indent=true&q.op=AND&q=${q}`
)
try {
res.status(200).json(result.data)
} catch (error) {
res.status(400).json({
numFound: 0,
suggestions: []
})
}
}
|