Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Faceting problem
PostPosted: Thu Feb 09, 2012 8:40 am 
Regular
Regular

Joined: Thu Jun 16, 2011 12:03 pm
Posts: 94
Hi all,

I am using 3.4 version of Hibernate Search and I am facing a faceting problem.

I have checked the indexes and the rows in my database and everything seems to be fine. The problem is that i have to obtain three facets and i just get one (the last one). I would say that this is a bug and i would like to know if anybody had the same problem as me...

this is my code

Code:
this.facetingRequest = this.builder.facet().name(type.toString())
               .onField(campoFacetador).discrete()
               .orderedBy(FacetSortOrder.COUNT_DESC)
               .includeZeroCounts(false).createFacetingRequest();

         this.fullTextQuery = this.fullTextSession.createFullTextQuery(
               this.query, Entity.class);

         this.facetManager = this.fullTextQuery.getFacetManager();

         this.facetManager.enableFaceting(this.facetingRequest);
               
         numFacets = this.facetManager.getFacets(
               this.facetingRequest.getFacetingName()).size(); //only 1 result


Thanks in advance,

pd: i tried to migrate to 4.0 (maybe this problem is fixed in this version) version but i have some errors with Un_tokenized enumerated:

Code:
@Field(name = "nombre_normalizado", index = [color=#FF0000]Index.UN_TOKENIZED[/color], indexNullAs = "NULL")


thanks in advance,


Top
 Profile  
 
 Post subject: Re: Faceting problem
PostPosted: Thu Feb 09, 2012 2:27 pm 
Hibernate Team
Hibernate Team

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

how does your entity and data look like? Can you post that as well? The code you are posting looks otherwise ok.
Regarding @Field, index = Index.UN_TOKENIZED is replaced by index = Index.YES and analyze =Analyze.YES.

--Hardy


Top
 Profile  
 
 Post subject: Re: Faceting problem
PostPosted: Fri Feb 10, 2012 5:19 am 
Regular
Regular

Joined: Thu Jun 16, 2011 12:03 pm
Posts: 94
Hi,

Basically, I have a book that has several topics (two in my test) but i just can get one topic if i try to facet.

I have created a test to try to see what is the problem.

It is a little bit complicated to post all this code...i'll try to make a resume.

If i create the query i get the result that i want. In the index this is the text:

-idBook 1
-topic.idTopic 1
-topic.idTopic 2

So, once i have the result, if i want to facet (with the above post code) for topic i think that i should get the two results...or just one?

This is the code:

Code:
public class BookEntity
{
......
    @IndexedEmbedded
    protected List<TopicBookEntity> topic;
.......
}

public class TopicBookEntity
{
.....
   @ContainedIn
   private BookEntity book;
   
   @IndexedEmbedded
   private TopicEntity topic;
....
}

@Indexed
public class TopicEntity
{
......
    @Field
    protected String nameTopic;
....
}






Thanks in advance,

Edited: After making some tests i have a conclusion with version 3.4. If an entity has a relation with several entities (1 Book 4 Topics), the faceting process for the entity Topic only gets one. Anybody has the same problem?


Top
 Profile  
 
 Post subject: Re: Faceting problem
PostPosted: Fri Feb 10, 2012 7:13 am 
Regular
Regular

Joined: Thu Jun 16, 2011 12:03 pm
Posts: 94
Hi,

I have found this Bug in jira.

https://hibernate.onjira.com/browse/HSEARCH-900

I think that this is my problem...

Is this fixed in version 4.0?

Thanks in advance,

edited: i have been thinking about integrating hibernate search with bobo-browse (http://code.google.com/p/bobo-browse/). I have found this link: http://groups.google.com/group/bobo-bro ... 365be9547c

any ideas on how to do that?


Top
 Profile  
 
 Post subject: Re: Faceting problem
PostPosted: Fri Feb 17, 2012 8:09 am 
Regular
Regular

Joined: Thu Jun 16, 2011 12:03 pm
Posts: 94
Hi all,

I have my first bobo version. I think that it works perfectly.

For faceting the results i am using the bobo library and i obtain the facets without any problem with 1 to Many relationships.

Just in case anybody had the same problem...

Thanks,


Top
 Profile  
 
 Post subject: Re: Faceting problem
PostPosted: Thu Apr 19, 2012 9:23 am 
Pro
Pro

Joined: Wed Nov 05, 2003 7:22 pm
Posts: 208
I also use Bobo. The main problem I always have had is that Bobo is read only and they have their own indexing layer that Bobo can hook into to make Bobo show real-time resuls. I've never succeeded integrating Bobo with Hibernate Search for this purpose and do a timed reload of Bobo, which is inefficient.
Did you manage to integrate Bobo directly with Hibernate Search? Should be easier in Hibernate Search 4.

Cheers,
Marc


Top
 Profile  
 
 Post subject: Re: Faceting problem
PostPosted: Mon Jan 27, 2014 9:45 am 
Regular
Regular

Joined: Thu Jun 16, 2011 12:03 pm
Posts: 94
Do we have the same problen on hibernate search 4.4.2?

I am working on the migration form 3.4 to 4.4.2 but I have a problem with facet count. I would say that the facet count is not correct after several tests....but only in some cases...I haven't a pattern for the moment....

Is there any bug on faceting?

Should I keep using bobo for faceting? which version should I use?

Thanks in advance!

Hibernator,

EDITED

I have found this link http://outbottle.com/hibernate-search-multivalue-facet-counts/

So I would say that Hibernate Search facet count is not working properly when using Multiple values...is that correct?


Top
 Profile  
 
 Post subject: Re: Faceting problem
PostPosted: Tue Jan 28, 2014 11:21 am 
Regular
Regular

Joined: Thu Jun 16, 2011 12:03 pm
Posts: 94
Hi,

I fixed the problem using this code:

https://forum.hibernate.org/viewtopic.php?f=9&t=1014392&p=2474550#p2474550

Just in case anybody has the same problem...

Hibernator.


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