问题
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