Hi Erez,

I don't think it is possible to combine regex with phrase out-of-the-box.
However, there is https://issues.apache.org/jira/browse/LUCENE-5205 for the 
task.

Can't you define your query in terms of pure regex?
something like /[0-9]{3} .* [0-9]{4}/

ahmet


On Sunday, May 22, 2016 1:37 PM, Erez Michalak <emicha...@varonis.com> wrote:
Hey,
I'm developing a search application based on SOLR 5.3.1, and would like to add 
to it regex search capabilities on a specific tokenized text field named 
'content'.
Is it possible to combine the default regex syntax within a phrase query (and 
moreover, within a proximity search)? If so, please instruct me how..

Thanks in advance,
Erez Michalak

p.s.
Maybe the following example will make my question clearer:
The query content:/[0-9]{3}/ returns documents with (at least one) 3 digits 
token as expected.
However,

*         the query content:"/[0-9]{3}/ /[0-9]{4}/" doesn't match the contents 
'123-1234' and '123 1234', even though they are tokenized to two tokens ('123' 
and '1234') which individually match each part of the query

*         the query content:"/[0-9]{3}/ example" doesn't match the content '123 
example'

*         even the query content:"/[0-9]{3}/" (same as the query that works but 
surrounded with quotation marks) doesn't return documents with 3 digits token!

*         etc.


________________________________
This email and any attachments thereto may contain private, confidential, and 
privileged material for the sole use of the intended recipient. Any review, 
copying, or distribution of this email (or any attachments thereto) by others 
is strictly prohibited. If you are not the intended recipient, please contact 
the sender immediately and permanently delete the original and any copies of 
this email and any attachments thereto. 

Reply via email to