[ 
https://issues.apache.org/jira/browse/LUCENE-7836?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16015561#comment-16015561
 ] 

Michael McCandless commented on LUCENE-7836:
--------------------------------------------

I suspect the problem is "Hello World" was indexed as 2 tokens, since you're 
indexing with whitespace tokenization, which means the regexp will never match 
a single token.

If you indexed "Hello World" as a single token then the regexp should match.

> Multiple Token Regex Search Not working
> ---------------------------------------
>
>                 Key: LUCENE-7836
>                 URL: https://issues.apache.org/jira/browse/LUCENE-7836
>             Project: Lucene - Core
>          Issue Type: Bug
>         Environment: Linux(Centos)
>            Reporter: Parmeet Singh Sachdeva
>            Priority: Blocker
>
> I am able to search for a regex query like H[a-z]llo but I am not able to 
> search for a regex query like H[a-z]llo Wor[a-z]d even though I have "Hello 
> World" in my source tree. I am not able to search multi-word regex queries.
> I am using OpenGrok which is, in turn, using 
> org.apache.lucene.search.RegexpQuery class of Lucene 6.5.0 which extends 
> AutomatonQuery.
> I have indexed the data based on whitespace tokenization.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to