On 4/3/07, ahFeel <[EMAIL PROTECTED]> wrote: > Thank you for you're usefull answer, even if it's quite a weird behavior > of Ferret's query parser, i'll try to go on with that :)
I can see why this behaviour may seem a little weird. Unfortunately, the way phrase queries are implemented, it is impossible to have a wildcard term within a phrase query. So "http://goo*" treats http://goo* as a term in a phrase query and runs it through the analyzer which then strips the wild-card character '*'. "http://goo"* is a phrase query with '*' at the end which doesn't have any meaning in ferret query language. http://goo* should work with a WhiteSpaceAnalyzer. The StandardAnalyzer strips the http:// (or file:/// or ftp://) from the beginning of terms during analysis. However, when you add a wild-card character to a query the term doesn't get analyzed. So basically the query http://google.fr will be converted to the query google.fr and will match, but the query http://goo* will not be analyzed and match http://goo* but there is no http://google.fr in the index, only google.fr, so you won't get a match. Searching for goo* however will work. What you might like to try is stripping http:// from your queries with a simple query.gsub(/http:\/\//, ''). Hope that helps, Dave -- Dave Balmain http://www.davebalmain.com/ _______________________________________________ Ferret-talk mailing list [email protected] http://rubyforge.org/mailman/listinfo/ferret-talk

