Reputation: 423
I am new to Solr.
I am trying to search for records containing single round bracket either '(' or ')'.
The query for searching the record is as follows:
q=( ( name: (*\(abc*) ) )
The above query breaks the solr search.
I am escaping the ( ) character by using the following regex:
value = value.replace(/([()])/g, '\\$1');
Can someone please help to troubleshoot this issue ?
Upvotes: 0
Views: 1387
Reputation: 15791
I am not very good with the regex so I cannot discern what is happening there, but this solr query should work:
q=name:*\(abc*
does it no?
As you can see in the lucene doc, the only char to escape in your query is (. ) would need to be escaped too if you search for it. But I understand in your example all the ) are just part of the language.
Upvotes: 2