-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Trimming white space before indexing
PostPosted: Thu Jun 10, 2010 10:40 am 
Beginner
Beginner

Joined: Tue Feb 03, 2009 12:29 pm
Posts: 49
hi,

We generate the Lucene index using Hibernate Search API. Since the indexed values have trailing white spaces, the search on the index fails since there is no exact match because the search terms do not have white spaces at the end. How can we trim the trailing white spaces in strings before indexing?

Thanks,
Seema


Top
 Profile  
 
 Post subject: Re: Trimming white space before indexing
PostPosted: Fri Jun 11, 2010 4:46 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi Seema,

you have to use the right analyzer for indexing to solve you problem. Have a look at the online documentation and how @AnalyzerDef can be used to build a custom analyzer. There exists a TrimFilterFactory which you can add to your custom analyzer definition which can take care of the trimming.

--Hardy


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.