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 Van Nguyen <vn...@ur.com> on 2006/07/17 21:40:36 UTC
Question regarding URL encoding
I'm trying to search my index using this search phrase: 1"
That returns zero search results and throws a ParseException: Lexical error at line... I can see that 1" is part of that particular document by searching that same document using a different search term.
How should the Lucene index store characters like that - and characters with accents (foreign language: á, í, ç, etc)? Should it be encoded in UTF-8 before and stored that way:
François or Fran%c3%a7ois
1" or 1%22
Re: Question regarding URL encoding
Posted by Chris Hostetter <ho...@fucit.org>.
it sounds like you may be confused by a couple of differnet things:
1) you are getting a parse exception bcause the '"' character is
meaningful to the query parser ... it thinks you are trying to do a phraes
search but you haven't finished the phrase, try escaping it with \"
2) just because you've *stored* the value '1"' in a field in your document
doesn't mean that value was *indexed* with the '"' preserved ... it really
depends on your analyzer. Lucene In Action has some great information on
understanding hwat the differnet analyzers do and how they work and how to
see exactly what terms are being indexed.
3) Lucene can store any legal Unicode character -- but what characters
actaully make it into your index depends on what Analyzer you use.
-Hoss
---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org