Richard,

WhitespaceTokenizer (the tokenizer that WhitespaceAnalyzer uses) really just 
tokenizes on space characters:

  /** Collects only characters which do not satisfy
   * [EMAIL PROTECTED] Character#isWhitespace(char)}.*/
  protected boolean isTokenChar(char c) {
    return !Character.isWhitespace(c);
  }

Otis

----- Original Message ----
From: Richard Gunderson <[EMAIL PROTECTED]>
To: java-user@lucene.apache.org
Sent: Monday, March 27, 2006 10:56:18 AM
Subject: Phrase Query query


Hi

I'm using PhraseQuery in conjunction with WhiteSpaceAnalyzer but it's
giving me slightly unusual results. If I have a text file containing the
text (quotes are just for clarity):

"Hello this is some text"

I don't find any results when I search.

But if I put spaces before and after the phrase:

" Hello this is some text "

then it does work. I'm breaking the phrase down into Terms, and setting the
slop to '0' by the way.

I'm kind of see that this makes sense, given the name: WhiteSpaceAnalyzer.
But aren't newlines, carriage-returns etc also treated as whitespace?

Thanks for your help!

Regards

Richard Gundersen
Honda UK - ISD
Tel: +44 (0)1753 590681
**************************************************************************
This email is confidential and intended solely for the use of the
individual to whom it is addressed. Any views or opinions presented are
solely those of the author and do not necessarily represent those of Honda
Motor Europe Ltd. or any of its group of companies.

If you are not the intended recipient, be advised that you have received
this email in error and that any use, dissemination, forwarding, printing
or copying of this email is strictly prohibited.

Visit our website: http://www.honda.co.uk
**************************************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to