You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@lucene.apache.org by Ranjit Kumar <Ra...@otssolutions.com> on 2011/04/26 15:55:04 UTC

lucene 3.0.3 | QueryParser | MultiFieldQueryParser

Hi,

I have created my own custom analyzer and uses jFlex to made search for c#, .net, c++ etc.

While I am trying to search c#, .net, c++ QueryParser parse .net to .net and C++ to C++. So it works fine. But in case of C# QueryParser parse it to C which makes trouble for me.

Also tried to use MultiFieldQueryParser but it also do the same.

Any help or suggestion will be appreciated!!!


Thanks & Regards,
Ranjit Kumar

=================================================================================================== Private, Confidential and Privileged. This e-mail and any files and attachments transmitted with it are confidential and/or privileged. They are intended solely for the use of the intended recipient. The content of this e-mail and any file or attachment transmitted with it may have been changed or altered without the consent of the author. If you are not the intended recipient, please note that any review, dissemination, disclosure, alteration, printing, circulation or Transmission of this e-mail and/or any file or attachment transmitted with it, is prohibited and may be unlawful. If you have received this e-mail or any file or attachment transmitted with it in error please notify OTS Solutions at info@otssolutions.com ===================================================================================================

RE: lucene 3.0.3 | QueryParser | MultiFieldQueryParser

Posted by Steven A Rowe <sa...@syr.edu>.
Hi Ranjit,

I suspect the problem is not QueryParser, since the <TERM> definition includes the '#' character (from <http://svn.apache.org/viewvc/lucene/java/tags/lucene_3_0_3/src/java/org/apache/lucene/queryParser/QueryParser.jj?view=markup#l1136>):

	| <#_TERM_START_CHAR: ( ~[ " ", "\t", "\n", "\r", "\u3000", "+", "-",
                                 "!", "(", ")", ":", "^", "[", "]", "\"",
                                 "{", "}", "~", "*", "?", "\\" ]
                             | <_ESCAPED_CHAR> ) >
	| <#_TERM_CHAR: ( <_TERM_START_CHAR> | <_ESCAPED_CHAR> | "-" | "+" ) >
	...
	| <TERM: <_TERM_START_CHAR> (<_TERM_CHAR>)* >

Are you sure that your custom JFlex Analyzer is not being given 'C#' and then stripping off the '#'?

You could work around this issue by pre-processing your query (and your documents) to replace C# with csharp or something like it that would not be broken up.

Steve

> -----Original Message-----
> From: Ranjit Kumar [mailto:Ranjit.Kumar@otssolutions.com]
> Sent: Tuesday, April 26, 2011 9:55 AM
> To: java-user-help@lucene.apache.org; java-user@lucene.apache.org
> Subject: lucene 3.0.3 | QueryParser | MultiFieldQueryParser
> 
> Hi,
> 
> I have created my own custom analyzer and uses jFlex to made search for
> c#, .net, c++ etc.
> 
> While I am trying to search c#, .net, c++ QueryParser parse .net to .net
> and C++ to C++. So it works fine. But in case of C# QueryParser parse it
> to C which makes trouble for me.
> 
> Also tried to use MultiFieldQueryParser but it also do the same.
> 
> Any help or suggestion will be appreciated!!!
> 
> 
> Thanks & Regards,
> Ranjit Kumar
> 
> =========================================================================
> ========================== Private, Confidential and Privileged. This e-
> mail and any files and attachments transmitted with it are confidential
> and/or privileged. They are intended solely for the use of the intended
> recipient. The content of this e-mail and any file or attachment
> transmitted with it may have been changed or altered without the consent
> of the author. If you are not the intended recipient, please note that
> any review, dissemination, disclosure, alteration, printing, circulation
> or Transmission of this e-mail and/or any file or attachment transmitted
> with it, is prohibited and may be unlawful. If you have received this e-
> mail or any file or attachment transmitted with it in error please notify
> OTS Solutions at info@otssolutions.com
> =========================================================================
> ==========================

Re: lucene 3.0.3 | QueryParser | MultiFieldQueryParser

Posted by haichengyl <ha...@sina.com>.
help to give some detail info 


2011-04-26 



haichengyl 



发件人: Ranjit Kumar 
发送时间: 2011-04-26  21:55:04 
收件人: java-user-help@lucene.apache.org; java-user@lucene.apache.org 
抄送: 
主题: lucene 3.0.3 | QueryParser | MultiFieldQueryParser 
 
Hi,
I have created my own custom analyzer and uses jFlex to made search for c#, .net, c++ etc.
While I am trying to search c#, .net, c++ QueryParser parse .net to .net and C++ to C++. So it works fine. But in case of C# QueryParser parse it to C which makes trouble for me.
Also tried to use MultiFieldQueryParser but it also do the same.
Any help or suggestion will be appreciated!!!
Thanks & Regards,
Ranjit Kumar
=================================================================================================== Private, Confidential and Privileged. This e-mail and any files and attachments transmitted with it are confidential and/or privileged. They are intended solely for the use of the intended recipient. The content of this e-mail and any file or attachment transmitted with it may have been changed or altered without the consent of the author. If you are not the intended recipient, please note that any review, dissemination, disclosure, alteration, printing, circulation or Transmission of this e-mail and/or any file or attachment transmitted with it, is prohibited and may be unlawful. If you have received this e-mail or any file or attachment transmitted with it in error please notify OTS Solutions at info@otssolutions.com ===================================================================================================

Re: lucene 3.0.3 | QueryParser | MultiFieldQueryParser

Posted by haichengyl <ha...@sina.com>.
hope to sent some detail about it.


2011-04-26 



haichengyl 



发件人: Ranjit Kumar 
发送时间: 2011-04-26  21:55:04 
收件人: java-user-help@lucene.apache.org; java-user@lucene.apache.org 
抄送: 
主题: lucene 3.0.3 | QueryParser | MultiFieldQueryParser 
 
Hi,
I have created my own custom analyzer and uses jFlex to made search for c#, .net, c++ etc.
While I am trying to search c#, .net, c++ QueryParser parse .net to .net and C++ to C++. So it works fine. But in case of C# QueryParser parse it to C which makes trouble for me.
Also tried to use MultiFieldQueryParser but it also do the same.
Any help or suggestion will be appreciated!!!
Thanks & Regards,
Ranjit Kumar
=================================================================================================== Private, Confidential and Privileged. This e-mail and any files and attachments transmitted with it are confidential and/or privileged. They are intended solely for the use of the intended recipient. The content of this e-mail and any file or attachment transmitted with it may have been changed or altered without the consent of the author. If you are not the intended recipient, please note that any review, dissemination, disclosure, alteration, printing, circulation or Transmission of this e-mail and/or any file or attachment transmitted with it, is prohibited and may be unlawful. If you have received this e-mail or any file or attachment transmitted with it in error please notify OTS Solutions at info@otssolutions.com ===================================================================================================