-->
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 Projection on @DateBridge field
PostPosted: Mon May 12, 2008 9:24 pm 
Newbie

Joined: Mon May 12, 2008 4:07 pm
Posts: 5
Hi,

I have a domain class with one Date field annotated with @DateBridge(resolution=Resolution.DAY). When I try to project that field in FullTextSearch with FullTextQuery.setProjection() method, I am getting a SearchException: "FieldBridge is not a TwoWayFieldBridge: class org.hibernate.search.bridge.String2FieldBridgeAdaptor". That really made me confused, since all built-in FieldBridges including DateBridge are TwoWayFieldBridges. Can anyone help me on this?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 13, 2008 11:45 pm 
Newbie

Joined: Fri Mar 04, 2005 4:27 pm
Posts: 13
How about your code? It would really help us to see what you are doing.

Cheers.


Top
 Profile  
 
 Post subject: Here is the code
PostPosted: Wed May 14, 2008 10:23 am 
Newbie

Joined: Mon May 12, 2008 4:07 pm
Posts: 5
@Entity
@Indexed
public class Resume implements Serializable {

/**
*
*/
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue
@DocumentId
private Long id;

@OneToOne
@IndexedEmbedded
private User applicant;

@Field(index = Index.TOKENIZED, store = Store.YES)
private String summary;

@Lob
@Field(name = "resume", index = Index.TOKENIZED, store = Store.NO)
@FieldBridge(impl = WordDocHandlerBridge.class)
private byte[] content; // MS Word Doc

@Temporal(value=TemporalType.DATE)
@Field(index = Index.UN_TOKENIZED, store = Store.YES)
@DateBridge(resolution = Resolution.DAY) // can't project
@Boost(2.0f)
private Date lastUpdated;
//...
}


FullTextQuery fq = fullTextEntityManager.createFullTextQuery(
bq, Resume.class);

fq.setProjection(FullTextQuery.SCORE, "id",
"summary",
"lastUpdated", // projection on this field
);

The lastUpdated field annotated with @DateBridge raised the error.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 03, 2008 4:47 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I've added this enhancement http://opensource.atlassian.com/project ... SEARCH-207

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