-->
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.  [ 4 posts ] 
Author Message
 Post subject: [Hibernate Search] Indexing composite key
PostPosted: Sun Nov 11, 2007 8:53 am 
Newbie

Joined: Wed Oct 24, 2007 5:49 pm
Posts: 5
Is there any way/syntax to index composite key?

For example if my key consist of (attribute_id, task_id) how should i annotate
those fields? Should i create some surrogate field with DocumentId and FieldBridge attached? Will it make it work?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 11, 2007 8:31 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
there is not built-in solution, the fieldbridge approach is the correct one (I haven't tested it myself though)

_________________
Emmanuel


Top
 Profile  
 
 Post subject: Indexing Composite key
PostPosted: Tue Nov 13, 2007 12:53 pm 
Newbie

Joined: Mon Nov 12, 2007 7:49 pm
Posts: 7
Location: Atlanta GA
I also tried to use fieldbridge (similar to the example in the doc) for the entity with composite key. But when I was creating the index, I got the following exception:

Bridge for document id does not implement IdFieldBridge: id

What might be the problem here? I am new in Hibernate Search. I appreciate any help.


Dan


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 13, 2007 1:14 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Oups,
Looks like a left over from a old class name
you should read
Code:
Bridge for document id does not implement TwoWayFieldBridge: id


The field bridge has to be able to convert a string into an object.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.