searching quote char with surround query parser in SOLR

戏子无情 提交于 2019-12-11 05:43:19

问题


I am trying to search for two subsequent words as follow:

{!surround}FieldName:first w second

The query works great, but SOLR throws parse exception when one of the words contains quote char, i.e

{!surround}FieldName:first w sec"ond

I have tried to escape the qutoe:

{!surround}FieldName:first w sec\"ond

but it didnt help. I tried also using the v parameter of LocalParams, but no good either.

{!surround v="first w sec\"ond"}FieldName

I am currently running Solr 4.0. Does anybody knows how to overcome this problem?


回答1:


Try this: {!surround}FieldName:(w(first,"sec\"ond"))



来源:https://stackoverflow.com/questions/16935363/searching-quote-char-with-surround-query-parser-in-solr

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!