2013-03-01 56 views
0

嗨,大家好,我試圖逃跑,其被傳遞到elasticsearch我GSP搜索查詢雙引號到目前爲止我有:Grails中逃脫報價爲GSP ES

<input id="q" name="q" type="text" class="large" value="${params?.q?.encodeAsHTML()}" .. 

但是,當我去我的web應用搜索字段和使用查詢類似「ABC」我知道在我的日誌文件大量異常,主要表現在:

org.apache.lucene.queryParser.ParseException: Cannot parse '("abc) AND recstatus:"public"': Lexical error at line 1, column 30. Encountered: <EOF> after : "" 

2013-03-01 11:35:06,874 [New I/O worker #3] DEBUG search.type - [Helleyes] [some_index][3], node[BZH5bHO8RX2va-HVpTDEng], [P], s[STARTED]: Failed to execute 
[[email protected]] 
org.elasticsearch.transport.RemoteTransportException: [Lasher][inet[/xxx.xxx.x.xxx:9300]][search/phase/query] 
Caused by: org.elasticsearch.search.SearchParseException: [some_index][3]: from[0],size[20]: Parse Failure [Failed to parse source [:) 
^[email protected]<83>sizeA20<84>queryery_string"abc) AND recstatus:"public"<8f>analyze_wildcard#ields䴩tle]] 

等..有什麼建議嗎?

回答

4

發現問題...

Config.groovy中有一個標誌設置:

grails.views.default.codec = "none" 

,這將覆蓋在GSP頁面的任何代碼。

您可以將此標誌或者設置爲:

grails.views.default.codec = "html" 

或覆蓋個人GSP文件。