-->
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.  [ 23 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: [Hibernate Search] Pdf, word, excel search
PostPosted: Mon Jun 25, 2007 9:45 am 
Regular
Regular

Joined: Wed Apr 25, 2007 10:29 am
Posts: 110
Location: France
Hello,

My search engine based on Hibernate Search works perfectly. Now, I want to index pdf, word and excel files.

I think I could use libraries to convert these files to text. Then, insert the text data into Hibernate database (which will index the text).

Do you have another solution ? Could I insert data in index without data in database ?

Thank you.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 26, 2007 3:37 am 
Regular
Regular

Joined: Wed Apr 25, 2007 10:29 am
Posts: 110
Location: France
Up


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 26, 2007 11:45 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Yes I have a solution
Write a Custom field bridge to index your excel file (probably delegating to a library)
and mark the proeprty as @Transient so that you don't need to store the data in the database

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 26, 2007 2:56 pm 
Regular
Regular

Joined: Wed Apr 25, 2007 10:29 am
Posts: 110
Location: France
Thank you again Emmanuel, could I put "@Transient" annotation only on a field, not a class ?

Because I just want to have a String field "word file content".


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 27, 2007 3:42 am 
Regular
Regular

Joined: Wed Apr 25, 2007 10:29 am
Posts: 110
Location: France
I made several tests.

I don't see a difference between
Code:
@Field(index=Index.TOKENIZED, store=Store.YES)
@Transient
private String titre;


and

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


If I don't want the data in database, I must delete the line :
Code:
<property name="titre" column="Titre" />
in mapping file.


It works with or without @Transient annotation.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 29, 2007 8:23 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
There is definitely a difference unless @Id is on a getter.
If @Id is on a getter then you need to @Transient the getter

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 29, 2007 8:45 am 
Regular
Regular

Joined: Wed Apr 25, 2007 10:29 am
Posts: 110
Location: France
Ok thank you Emmanuel. My id is on getter ;).


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 10, 2007 10:17 am 
Regular
Regular

Joined: Wed Apr 25, 2007 10:29 am
Posts: 110
Location: France
I have a little problem ...

I have a field :
Code:
@Field(index=Index.TOKENIZED, store=Store.YES)
@Transient
@Boost(0.5f) // indexation moitie moins importante que celle des autres champs
private String pleinTexte;


First of all, I don't see the boost factor in lucene indexes :
Image
(1.0 displayed).

Then, I would like to have the value in my indexes but not in database.
In the beginning, I deleted the line
Code:
<property name="pleinTexte" column="PleinTexte" />

in my Mapping.hbm.xml and I deleted setPleinTexte and getPleinTexte methods.

It works, but when I insert a second object, the field documents.pleinText is updated, not added.

The only solution to have 2 different values for 2 different objects is to keep the line in Mapping.hbm.xml (with or without @Transient, there are the 2 values in database). But if I keep the line ... I have values in database :S


I don't know what is the solution. I thought that to remove database values, we must remove the line in Mapping.hbm.xml and add @Transient annotation, but it changed index behaviour :S

Thank you.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 11, 2007 2:24 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
if you're using hbm.xml files (ie if your entity is not marked as @Entity, then @Transient is not necessary

@Boost is tested in org.hibernate.search.test.fieldAccess.FieldAccessTest in the unit test suite

I suspect you might once again having issues with getters and attribute access

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 12, 2007 8:58 am 
Regular
Regular

Joined: Wed Apr 25, 2007 10:29 am
Posts: 110
Location: France
I don't understand, the only thing I changed is removing :
Code:
<property name="pleinTexte" column="PleinTexte" type="text"/>


Full code removed.


Last edited by fabreax on Wed Aug 01, 2007 4:17 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 12, 2007 2:59 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Can you try and run with the debugger to see what's going on. I haven't see anything obvious.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 13, 2007 11:00 am 
Regular
Regular

Joined: Wed Apr 25, 2007 10:29 am
Posts: 110
Location: France
I don't know where to put a breakpoint in hibernate search java files ...


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 16, 2007 11:39 am 
Regular
Regular

Joined: Wed Apr 25, 2007 10:29 am
Posts: 110
Location: France
emmanuel wrote:
@Boost is tested in org.hibernate.search.test.fieldAccess.FieldAccessTest in the unit test suite


I made a test :
http://opensource.atlassian.com/project ... HSEARCH-96

Thank you.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 24, 2007 7:21 am 
Regular
Regular

Joined: Wed Apr 25, 2007 10:29 am
Posts: 110
Location: France
@Boost seems to work because I displayed the results score.

The problem is that boost value is always 1.0 in Luke !


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 25, 2007 3:04 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Ah so you mean that Luke has an issue but the boost value is properly defined?

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 23 posts ]  Go to page 1, 2  Next

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.