What do you mean by "use index and search analyzers". Don't you always have to pass in an analyzer? I am using the standardanalyzer in both cases.
Which analyzer are you recommending I use for this? -----Original Message----- From: Ramana Jelda [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 18, 2006 3:45 AM To: java-user@lucene.apache.org Subject: RE: hypens Hi, I would use index & search analyzers in this case.. "b-trunk" is analyzed & indexed as b,btrunk,trunk Search term "b-trunk" is anlayzed using search analyzer as "btrunk" and searched. U will find the result.. Similarly for 12412-235, 12412-121, 12412-etc , indexed as 12412,12412235,235 etc.... So obviously it will find 12412 search term. Good luck, Jelda > -----Original Message----- > From: John Powers [mailto:[EMAIL PROTECTED] > Sent: Monday, April 17, 2006 6:59 PM > To: java-user@lucene.apache.org > Subject: hypens > > Hello, > > > > If I have a user search for "b-trunk" I would like them to be able to > > find "b-trunk" (with hypen). I would also like someone searching for > > "b trunk" to also find "b-trunk". > > > > On the other side, if someone searches for 12412 I would like > them to be > > able to find 12412-235, 12412-121, 12412-etc... as well > as letting > > someone type in 12412-235 directly and get a good result > list: the one item would be best, but a larger list with that > one on top is good too. > > > > So for now I am using the standardanalyzer. I do a search for what > > they give me in quotes on all fields as well as the same > thing w/o quotes. When I print out the final query the half > of the overall query in quotes seems to have the hypens > stripped out, but the w/o quotes > > version doesn't...so this lets me find what I want. But I have each > > search phrase in the final query twice now. it seems to work fine, > > but it seems pretty inelegant--unelegant even. > > > > It seems like I can't just strip out the hypens, nor keep > them. I am > > storing the name as keyword, but everything else as Text. I thought > > that would matter but a description or keyword or other field > may have something like "this also relates to 23523-235" so > if someone was searching for 23523 I would also want this in > the list... and if they > > searched for the 23523-235 then I would also want this still. So I > > don't know if its solvable by the type of field I use to > index it. Or > > do I have to store each field twice with different analyzer? > That seems just as clumsy as my double-search solution. > > > > Any thoughts? > > > > --------------------------------------------------------------------- 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]