Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Lucene: Java-User

# as a special character?

 

 

Lucene java-user RSS feed   Index | Next | Previous | View Threaded


aradon at gmail

Jul 6, 2011, 8:19 AM

Post #1 of 2 (236 views)
Permalink
# as a special character?

Hello,

First off I am using the QueryParser with the standardanalyzer. It
seems that whenever I search for the # symbol, nothing is found. This
wouldn't be a problem but the documents I am searching have C# used
and needing to be searched for.

I have tried escaping the # symbol but when I do escape it I just
get the following after calling parse from queryparser using "C#":
Text:c

This is the same as searching just C. Now I know that the toString
can't be relied upon for special characters (C++ escaped correctly is
shown as Text:c), but I know c++ works since it only returns those
hits involved with c++ and not just the letter c (like c# is)

Any help would be appreciated!

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene


ian.lea at gmail

Jul 8, 2011, 4:31 AM

Post #2 of 2 (215 views)
Permalink
Re: # as a special character? [In reply to]

Searching for special characters can be a pain. There is a message
thread from this list called "Lucene Analyzer that can handle C++ vs
C#" that might help.


--
Ian.


On Wed, Jul 6, 2011 at 4:19 PM, Aradon Strider <aradon [at] gmail> wrote:
> Hello,
>
>  First off I am using the QueryParser with the standardanalyzer.  It
> seems that whenever I search for the # symbol, nothing is found.  This
> wouldn't be a problem but the documents I am searching have C# used
> and needing to be searched for.
>
>  I have tried escaping the # symbol but when I do escape it I just
> get the following after calling parse from queryparser using "C#":
> Text:c
>
>  This is the same as searching just C.  Now I know that the toString
> can't be relied upon for special characters (C++ escaped correctly is
> shown as Text:c), but I know c++ works since it only returns those
> hits involved with c++ and not just the letter c (like c# is)
>
> Any help would be appreciated!
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
> For additional commands, e-mail: java-user-help [at] lucene
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe [at] lucene
For additional commands, e-mail: java-user-help [at] lucene

Lucene java-user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.