-->
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.  [ 11 posts ] 
Author Message
 Post subject: [Hibernate Search]Projections returning list of null objects
PostPosted: Thu Jan 03, 2008 6:14 pm 
Newbie

Joined: Thu Dec 20, 2007 1:49 pm
Posts: 9
I'm having an issue with projections with hibernate search. My document includes several fields including "name" and "count". When executing the code below it passes back a list of the proper size, but the object arrays are all null (i.e. [null,null]). Is there something that I'm doing wrong here?

Code:
EntityManager em = getEntityManager();
FullTextEntityManager fullTextEntityManager = Search.createFullTextEntityManager(em);

FullTextQuery fullTextQuery = fullTextEntityManager.createFullTextQuery( parseQuery(query), Label.class);

fullTextQuery.setProjection("name", "count");

List<Object[]> list = fullTextQuery.getResultList();


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 04, 2008 7:41 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I bet the fields are not stored @Field(store=Store.YES)

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 04, 2008 2:25 pm 
Newbie

Joined: Thu Dec 20, 2007 1:49 pm
Posts: 9
emmanuel wrote:
I bet the fields are not stored @Field(store=Store.YES)


I'm using a class bridge to perform the index. Here's the annotation:

@ClassBridge(name = "label", index = Index.UN_TOKENIZED, store = Store.YES, impl = LabelBridge.class)

I can also see all the values in LUKE, so I'm pretty sure they're stored.

I even tried doing a projection using FullTextQuery.THIS, and that returned null entity objects...

Could this be an issue with the class bridge?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 04, 2008 2:48 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
AgentHubcap wrote:
emmanuel wrote:
I bet the fields are not stored @Field(store=Store.YES)


I'm using a class bridge to perform the index. Here's the annotation:

@ClassBridge(name = "label", index = Index.UN_TOKENIZED, store = Store.YES, impl = LabelBridge.class)

I can also see all the values in LUKE, so I'm pretty sure they're stored.

I even tried doing a projection using FullTextQuery.THIS, and that returned null entity objects...

Could this be an issue with the class bridge?


Ah right, ClassBridge are not handled in projection (open a JIRa issue please with a test case).

FullTextQuery.THIS returns null? I have hard time to believe this. Can you write a minimal reproducible test case and attach it to JIRA.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 04, 2008 2:54 pm 
Newbie

Joined: Thu Dec 20, 2007 1:49 pm
Posts: 9
emmanuel wrote:
AgentHubcap wrote:
emmanuel wrote:
I bet the fields are not stored @Field(store=Store.YES)


I'm using a class bridge to perform the index. Here's the annotation:

@ClassBridge(name = "label", index = Index.UN_TOKENIZED, store = Store.YES, impl = LabelBridge.class)

I can also see all the values in LUKE, so I'm pretty sure they're stored.

I even tried doing a projection using FullTextQuery.THIS, and that returned null entity objects...

Could this be an issue with the class bridge?


Ah right, ClassBridge are not handled in projection (open a JIRa issue please with a test case).

FullTextQuery.THIS returns null? I have hard time to believe this. Can you write a minimal reproducible test case and attach it to JIRA.


The object itself isn't null, but every field in it is null.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 05, 2008 5:39 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
THIS is loaded by Hibernate Core, so unless the object contains null properties in DB...

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 14, 2009 10:08 am 
Newbie

Joined: Tue Apr 14, 2009 10:03 am
Posts: 7
emmanuel wrote:
Ah right, ClassBridge are not handled in projection (open a JIRa issue please with a test case).

Is this already resolved? I am experiencing the same problem here. I searched Jira but could not find anything related there.

If not I would create a new Jira issue.

-Tom


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 14, 2009 10:11 am 
Newbie

Joined: Tue Apr 14, 2009 10:03 am
Posts: 7
emmanuel wrote:
Ah right, ClassBridge are not handled in projection (open a JIRa issue please with a test case).

Is this already resolved? I am experiencing the same problem here. I searched Jira but could not find anything related there.

If not I would create a new Jira issue.

-Tom


Top
 Profile  
 
 Post subject: Re: [Hibernate Search]Projections returning list of null objects
PostPosted: Wed May 20, 2009 5:37 pm 
Newbie

Joined: Tue Apr 14, 2009 10:03 am
Posts: 7
Opened Jira issue HSEARCH-372.


Top
 Profile  
 
 Post subject: Re: [Hibernate Search]Projections returning list of null objects
PostPosted: Wed May 20, 2009 6:00 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
thanks for the report, unfortunately what's not in JIRA gets lost.
If you would like to provide a testcase it's quite easy if you give a look to the sources,
as there are lots of simple tests. I'd recommend to learn how to make standalone testcases
anyway, it will save you a lot of time.

Here are some pointer to download the source code and setup your environment:
https://www.hibernate.org/462.html

If you have any trouble please report, so we can improve something.

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


Top
 Profile  
 
 Post subject: Re: [Hibernate Search]Projections returning list of null objects
PostPosted: Thu May 21, 2009 6:21 am 
Newbie

Joined: Tue Apr 14, 2009 10:03 am
Posts: 7
Ok, thanks for the pointer, I will have a look. Standalone testcases, especially if EJB3 beans are involved, are somewhat painful in the begining. Guess I simply was too lazy yet ;-)


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