Re: Help on the Query Parser
On Wednesday 24 November 2004 08:16, Morus Walter wrote: Lucene itself doesn't handle wildcards within phrases. This can be added using PhrasePrefixQuery (which is slightly misnamed): http://jakarta.apache.org/lucene/docs/api/org/apache/lucene/search/PhrasePrefixQuery.html Regards Daniel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: Help on the Query Parser
Hi Daniel, I couldn't figure out how to use the PharsePrefixQuery with a phase like java* developer. It only provides method to add terms. Can a term contain wildcard character in lucene? Thanks, Terence On Wednesday 24 November 2004 08:16, Morus Walter wrote: Lucene itself doesn't handle wildcards within phrases. This can be added using PhrasePrefixQuery (which is slightly misnamed): http://jakarta.apache.org/lucene/docs/api/org/apache/lucene/search/PhrasePrefixQuery.html Regards Daniel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Get your free email account from http://www.trekspace.com Your Internet Virtual Desktop! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Re: Help on the Query Parser
Hi Morus, I want to search for the string like below: - java developer - javascript developer By searching java*, it will return more than I want. That's why I am thinking java* developer. Terence Terence Lai writes: Look likes that the wildcard query disappeared. In fact, I am expecting text:java* developer to be returned. It seems to me that the QueryParser cannot handle the wildcard within a quoted String. That's not just QueryParser. Lucene itself doesn't handle wildcards within phrases. You could have a query text:java* developer if '*' isn't removed by the analyzer. But it would only search for the token 'java*' not any expansion of that. I guess this is not, what you want. Morus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Get your free email account from http://www.trekspace.com Your Internet Virtual Desktop! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help on the Query Parser
Hi all, I am trying to use the QueryParser.parse() to parse a query string like java* developer. Note that I want the wildcard string, java*, followed by the word developer. The following is the code. - String qryStr = \java* developer\; String fieldname = text; StandardAnalyzer analyzer = new StandAnalyzer(); Query qry = org.apache.lucene.queryParser.QueryParser.parse(qryStr, fieldname, analyzer); - When I do a qryStr.toString() to print out the contents, I got the following output: - text:java developer - Look likes that the wildcard query disappeared. In fact, I am expecting text:java* developer to be returned. It seems to me that the QueryParser cannot handle the wildcard within a quoted String. Does anyone has a solution on this? Am I missing something in the code? Thanks, Terence -- Get your free email account from http://www.trekspace.com Your Internet Virtual Desktop! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help on the Query Parser
Terence Lai writes: Look likes that the wildcard query disappeared. In fact, I am expecting text:java* developer to be returned. It seems to me that the QueryParser cannot handle the wildcard within a quoted String. That's not just QueryParser. Lucene itself doesn't handle wildcards within phrases. You could have a query text:java* developer if '*' isn't removed by the analyzer. But it would only search for the token 'java*' not any expansion of that. I guess this is not, what you want. Morus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]