-->
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: How do you implement search with single input formfield
PostPosted: Tue May 03, 2011 2:29 pm 
Newbie

Joined: Tue May 03, 2011 2:23 pm
Posts: 3
All,

I'm in the process of implementing a search for a web application using hibernate search (probably that's why I end up at this forum) and have a question about how to implement/configure it. We want to have a single field which has to be matched against information which is stored in different fields in the lucene index. In the former web application we had just one field which contained the searchable data. The @Field annotation places everything in a field of the same name as the property.
So what to do, should I some how create an extra field containing all the searchable information or is there some other way to search over all fields at once?


Top
 Profile  
 
 Post subject: Re: How do you implement search with single input formfield
PostPosted: Fri May 06, 2011 4:47 am 
Hibernate Team
Hibernate Team

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

Using the @Fields annotation you can specify multiple Lucene fields for a single class attribute. You can change the field name, which analyzer to use, whether the field should be tokenized, etc
This in particular useful when you want to store the field once as is (eg for sorting) and once analyzed.

--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.