lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <e...@ehatchersolutions.com>
Subject Re: Zero hits for queries ending with a number
Date Sat, 03 Apr 2004 13:19:29 GMT
Ok, we're getting somewhere now.

So, where is the exception you encountered when using this utility 
code?!  (i.e. it didn't thrown an exception, so something is different 
in your usage in your code).

I tried this:

     Query query = MultiFieldQueryParser.parse("date:[20030101 TO 
20030202]", new String[] { "id", "title", "summary", "contents", "date" 
}, new GermanAnalyzer());

     System.out.println("query = " + query.toString());


And it worked fine (only duplicated the query for each field).  No 
exception at all.  Of course I'm guessing on your analyzer since you 
didn't provide that detail (although it shouldn't matter in the 
exception you experienced).

On Apr 3, 2004, at 6:06 AM, lucene@nitwit.de wrote:
> SnowballAnalyzer("German2"):
>
> Analzying "http://www.yahoo.com/foo/bar.html"
> 	org.apache.lucene.analysis.snowball.SnowballAnalyzer:
> 		[http] [www.yahoo.com] [foo] [bar.html]

So this is the analyzer you want to use, right?

Wildcards should work on "www.yahoo.*"

What is the "German2" stemmer for Snowball?

You've introduced a lot of variables to your equation here.... 
MultiFieldQueryParser and a non-standard Snowball stemmer.  All of 
which I had to pull out of you for details, each of which is critical 
to understanding the problem.

>> analyzer you are using, and also do the same on .toString of the query
>> you parsed.  Those two pieces of info will tell all.
>
> "url:www.yahoo* url:www.yahoo* url:www.yahoo* url:www.yahoo* 
> url:www.yahoo*
> url:www.yahoo*"
>
> Well, I actually use a MultiFieldQueryParser, that's probably why the 
> term
> does appear so often. Strange parser, it should be clear that am 
> explicit
> "url:xyz" should only look in the url field, shouldn't it?

Do you really need to query on multiple fields?  Why not just use the 
plain QueryParser?  If you need an aggregate field, create one at index 
time.  QueryParsing is problematic enough, but adding in MFQP makes it 
even more complicated.

Which Analyzer are you using for indexing?  This same SnowballAnalyzer 
with "German2" stemmer?

	Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-user-help@jakarta.apache.org


Mime
View raw message