curl測試:
curl http://121.40.86.204:8983/solr/test/select?q=681&rows=20&wt=json&indent=true
或
value='echo -n "海藍之謎" | xxd -ps | tr -d '\n' | sed -r 's/(..)/%\1/g' '
echo $value # %e5%bc%a0%e4%b8%89
# 然後用curl傳遞編碼後的參數
curl -G \
--data-urlencode "q=${value}" \
--data-urlencode "rows=20" \
--data-urlencode "wt=json" \
--data-urlencode "indent=true " \
"http://121.40.86.204:8983/solr/test/select"
'''
{
"responseHeader":{
"status":0,
"QTime":19,
"params":{
"q":"echo -n \"海藍之謎\" | xxd -ps | tr -d n | sed -r s/(..)/%1/g ",
"indent":"true ",
"rows":"20",
"wt":"json"}},
"response":{"numFound":100,"start":0,"docs":[
{
"question":"海藍之謎修護精萃液的作用?|海藍之謎修護精萃液的作用功效?",
"id":"681",
"_version_":1671170831335555072},
{
"question":"海藍之謎眼霜適用年齡?",
"id":"188",
"_version_":1671170831324020736},
{
"question":"海藍之謎產品用了之後長痘痘?",
"id":