lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ramana Jelda" <ramana.je...@ciao-group.com>
Subject RE: hypens
Date Tue, 18 Apr 2006 08:44:56 GMT
 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:jpowers@configureone.com] 
> 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: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message