Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Ability to index the text that matches a particular pattern.
PostPosted: Sun Apr 22, 2012 6:45 am 
Newbie

Joined: Wed Mar 21, 2012 4:43 am
Posts: 7
Hello.
I am using in my project "Hibernate Search". Everything works fine, but I have a one question.
Data in my project stored in a specific format: "text [hidden words]". Hidden words aren't shown to users.
Can I not index the text, which correspond to a particular pattern(using regex for example)?


Top
 Profile  
 
 Post subject: Re: Ability to index the text that matches a particular pattern.
PostPosted: Mon Apr 23, 2012 6:18 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2296
Location: Third rock from the Sun
Hi,
you can do that in two ways:

1) (simpler) create a custom StringBridge and register it on the fields you need to "filter": See also http://docs.jboss.org/hibernate/search/4.1/reference/en-US/html_single/#d0e4037;
your implementation should just remove the [...] part.

2) (better reusable and better performance) create a custom Analyzer. For some examples I'd suggest to look into the Lucene source code as there are many Analyzers in it.

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 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.