Oh, sorry, didn't catch that. There are some spurious asterisks in your message, as displayed by gmail anyway. The most recent one has "block-major** *"
I don't know the answer. Some unwanted interaction between the tokenization and query parser and wildcards? If it's going to split "block-major-57" into "block" and "major-57" will it also split query "block-major*" into "block" and "major*" or leave it as "block-major*". The first might be expected to work, the latter wouldn't. Maybe try storing this field without analysis, or just with something simple like downcasing, and searching with a PrefixQuery? I think that would work. -- Ian. On Fri, Sep 20, 2013 at 1:48 PM, Ramprakash Ramamoorthy <youngestachie...@gmail.com> wrote: > On Fri, Sep 20, 2013 at 6:11 PM, Ian Lea <ian....@gmail.com> wrote: > >> It's reasonable that "block-major" won't find anything. >> "block-major-57" should match. >> > > Thank you Ian, I understand. But my question is why wouldn't " > block-major** *" match?, please note the wildcard at the end! Thanks. > >> >> The split into block and major-57 will be because, from the javadocs >> for ClassicTokenizer, "Splits words at hyphens, unless there's a >> number in the token, in which case the whole token is interpreted as a >> product number and is not split.". So I guess it splits on the first >> hyphen but not the second. >> >> ClassicAnalyzer/Tokenizer is general purpose and will never meet >> everyone's requirement all the time. You could try a different >> analyzer, or build your own. That's what the javadoc recommends. >> >> >> -- >> Ian. >> >> >> On Fri, Sep 20, 2013 at 1:26 PM, Ramprakash Ramamoorthy >> <youngestachie...@gmail.com> wrote: >> > Sorry, hit the send button accidentally the last time. Please read below >> : >> > >> > Hello, >> > >> > We're using lucene 4.1. We have the word "*block-major-57*" >> > indexed. Using the classic analyzer, we get the following tokens : >> *block*and >> > *major-57*. >> > >> > I search for *block-major*, *the document doesn't match. >> > However searching for *block** works perfect. Is this a bug, or am I >> doing >> > something wrong? >> > >> > >> > -- >> > With Thanks and Regards, >> > Ramprakash Ramamoorthy, >> > Chennai, India. >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org >> For additional commands, e-mail: java-user-h...@lucene.apache.org >> >> > > > -- > With Thanks and Regards, > Ramprakash Ramamoorthy, > Chennai, India --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@lucene.apache.org For additional commands, e-mail: java-user-h...@lucene.apache.org