Re: RegexQuery Incomplete Results

2009-05-12 Thread Seid Mohammed
Thanks it works On 5/12/09, Mark Miller wrote: > Use JavaUtilRegexCapabilities or put the Jakarata RegEx jar on your > classpath: http://jakarta.apache.org/regexp/index.html > > -- > - Mark > > http://www.lucidimagination.com > > > > Seid Mohammed wrote: >> I need it similar functionality, but w

Re: RegexQuery Incomplete Results

2009-05-12 Thread Mark Miller
Use JavaUtilRegexCapabilities or put the Jakarata RegEx jar on your classpath: http://jakarta.apache.org/regexp/index.html -- - Mark http://www.lucidimagination.com Seid Mohammed wrote: I need it similar functionality, but while running the above code it breaks after outputing the following

Re: RegexQuery Incomplete Results

2009-05-12 Thread Ian Lea
The Jakarta regexp package is a separate download. http://jakarta.apache.org/regexp/index.html. -- Ian. On Tue, May 12, 2009 at 3:21 PM, Seid Mohammed wrote: > I need it similar functionality, but while running the above code it > breaks after outputing the following > =

Re: RegexQuery Incomplete Results

2009-05-12 Thread Seid Mohammed
I need it similar functionality, but while running the above code it breaks after outputing the following Added Knowing yourself Added Old clinic Added INSIDE Added Not INSIDE Default regexcapabilities=org.apache.lucene.sear

Re: RegexQuery Incomplete Results

2009-05-11 Thread Huntsman84
That's it!!! The problem was with the regular expression, the one I need is ".*IN"!! Thank you so much, I was turning mad... =) Ian Lea wrote: > > The little self-contained program below runs regex queries for a few > regexps against a few phrases for both the java.util and jakarta > regexp p

Re: RegexQuery Incomplete Results

2009-05-11 Thread Ian Lea
The little self-contained program below runs regex queries for a few regexps against a few phrases for both the java.util and jakarta regexp packages. Output when run with lucene 2.4.1 and jakarta-regexp 1.5 is Added Knowing yourself Added Old clinic Added INSIDE Added Not INSIDE Default regexc

Re: RegexQuery Incomplete Results

2009-05-11 Thread Huntsman84
The RegexQuery class uses that package, and for that reason the expression matches. If my records contained only one word each, this code would work, but I need to apply that regular expression to a phrase... Ian Lea wrote: > > The default regex package is java.util.regex and I can't see anywh

Re: RegexQuery Incomplete Results

2009-05-11 Thread Ian Lea
The default regex package is java.util.regex and I can't see anywhere that you tell it to use the Jakarta regexp package. So I don't think that ".in" will match. Also, you are storing your contents field as NOT_ANALYZED so you will need to be wary of case sensitivity. Maybe this is what you want

RE: RegexQuery Incomplete Results

2009-05-11 Thread Huntsman84
This is the code for searching: String index = "index"; String field = "contents"; IndexReader reader = IndexReader.open(index); Searcher searcher = new IndexSearcher(reader); System.out.println("Enter query: "); String line = ".IN.";//in jakarta regexp this is like * IN * RegexQuery rxquery = n

RE: RegexQuery Incomplete Results

2009-05-08 Thread Steven A Rowe
On 5/8/2009 at 9:13 AM, Ian Lee wrote: > I'm surprised that it matches either - don't you need ".*in" where .* > means match any character zero or more times? See the javadoc for > java.util.regex.Pattern, or for Jakarta Regexp if you are using that > package. > > Unless you're an expert in regex

Re: RegexQuery Incomplete Results

2009-05-08 Thread Ian Lea
I'm surprised that it matches either - don't you need ".*in" where .* means match any character zero or more times? See the javadoc for java.util.regex.Pattern, or for Jakarta Regexp if you are using that package. Unless you're an expert in regexps it is probably worth playing with them outside y

Re: RegexQuery Incomplete Results

2009-05-08 Thread Erick Erickson
I don't understand your regex at all. Isn't it looking for in with any *single* character in front and back? Given your example, I don't see how you're getting anything back at all. Is this code you're actually executing or just an example? What does toString and/or Explain show? Think about getti