Hi, I think using Field.Index.NOT_ANALYZED means ignoring StandardAnalyzer, so we index "sql. server" as one word. You may use luke to see how this field is indexed. In this case we can only search whole term (without case change even), if using the StandardAnalyzer to analyze "sql. server" we should not get result? Best regards, Lisheng
-----Original Message----- From: Ranjit Kumar [mailto:ranjit.ku...@otssolutions.com] Sent: Wednesday, February 09, 2011 9:39 PM To: java-user-h...@lucene.apache.org; java-user@lucene.apache.org Subject: lucene 3.0.3 | phrase query problem Hi, I am using SpanQuery and SpanNearQuery to get phrase query like "Sql Server". In my text file in which I am searching, it is present like (sql. server) mean 'sql dot server' which is not a span like "Sql Server". While searching for phrase query "Sql Server". It gives result for (sql. server) which is not correct. I am using StandardAnalyzer on both side while creating index or searching on files. While creating index Field.Index.NOT_ANALYZED is used. Please, give your suggestion !!! Thanks & Regards, Ranjit Kumar Associate Software Engineer cid:image002.jpg@01CB7089.C0069B40 US: +1 408.540.0001 UK: +44 208.099.1660 India: +91 124.474.8100 | +91 124.410.1350 FAX: +1 408.516.9050 <http://www.otssolutions.com> http://www.otssolutions.com =================================================================================================== 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 i...@otssolutions.com ===================================================================================================