PDA

View Full Version : Java: Help with apache-lucene


AsifTheManRahman
May 17, 2006, 03:20 PM
I need to know how the following analyzers work:

Whitespace
Keyword

I am looking for an analyzer that will result in a hit if the string that is queried appears in the document being searched. For example, if I am looking for "A_B_C", then I want the analyzer to detect all of the following patterns: XXXA_B_CXXX, A_B_C, A_B_CXXX, XXXA_B_C, where XXX can be any character, string, etc.

I am using the Whitespace analyzer right now and it looks like it only detects A_B_C when it appears in the document as a single string, i.e. wrapped around by white spaces (which is what the Whitespace analyzer is supposed to do, if I'm not mistaken). However, I have tried using the Keyword Analyzer as well, but in vain. I would like to know how exactly this analyzer would tokenize, say, the patterns mentioned above.

Is there any other analyzer anywhere that I could use?

Thanks in advance.

AsifTheManRahman
May 17, 2006, 03:35 PM
oh and the Simple and Standard analyzers are no good either because they strip the underscores off the keys