-->
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.  [ 2 posts ] 
Author Message
 Post subject: is hibernate search adapted for my problem ?
PostPosted: Mon Nov 17, 2008 10:52 am 
Beginner
Beginner

Joined: Tue Feb 12, 2008 3:53 pm
Posts: 38
Hi,
first of all congratulation for the authors of this book. I have to summarize in 2 days in what HIBERNATE SEARCH can help me for my problem and I cannot read the whole book, so I just began to read it and I have a few preliminary questions.

Here is my problem : I work in a web application using Hibernate (and JSP, HTML, SPRING, JAVA) and we are looking for a technology that can resolve the following problem : We have a database with a lot of objects mapped to that database. The structure of the database is very complex. The interface to access the application is accessible to different users who have each their proper role in the application. For example, there is a role ARCHITECT, a role DESIGNER, a role ADMINISTRATOR etc.......Each user who connect in the application has his proper view of the model, that is, for example the ARCHITECT has a view on several (not all) Studies (object STUDY) , a part of group of Items of these studies (object ItemGroup), and a part of Items of these ItemGroups (object Item). This ARCHITECT has a view too on several (not all) sites ( object Site), and a view on a part (not all) of other users (not all users) (object USER). We are going to implement the following facility : This ARCHITECT may enter characters in a text box and as soon as he has entered more than (or equal to) 3 characters, and each time he has entered one more character, an ajax request is made to find all the accessible objects (he is allowed to access among “Study”, “ItemGroup”, “Item”, “Site”, “User”) which have their name or another of their property containing the entered characters (in the text box).

My question is : is HIBERNATE SEARCH adapted for this kind of research ? First of all I have doubts about the quickness of the answer, knowing that the research can be made on tens of objects and thousand of rows for each object. Does HIBERNATE SEARCH will help me to get an answer instantly ?

I have too two other questions :

1) I may enter for example “ant” in the text box. If I suppose there are three objects which have one of their property containing “avantage”, or “antenna”, or “accountant” I doubt that HIBERNATE SEARCH will help me to find these three words. Indeed I began to read the book and from what I understood, HIBERNATE SEARCH put an index on each word contained in a property. I suppose that HIBERNATE SEARCH can find the word “avantage”, the word “antenna” and the word “accountant” in a property but it cannot find the names containing “ant”. Can HIBERNATE SEARCH be helpful for this kind of research ? And if so, will the answer be as quick as if it was for a whole word ?

2) When I am going to make a research on an entered expression, I will have to make a first selection on the appropriate objects that for example the ARCHITECT is allowed to access : he is allowed to access only some of the studies and among these studies only some of the ItemGroup, and among these ItemGroup only some of the Item. Only after this pre-selection, I suppose that HIBERNATE SEARCH comes into play. But indeed, is it appropriate for HIBERNATE SEARCH ? I understood that HIBERNATE SEARCH can make a research on all the objects belonging to a Class, but is it possible to make a research on a set of pre-selected objects ?

Thank you for your reply in advance, I just began to read the book and I am not an expert, so I can’t answer to those first preliminary questions in two days. Your help will be precious.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 24, 2008 10:00 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Hi,
yes it is suited for what you are needing; you'll need filters to implement the security, but this is nothing new and not very difficult to achieve.

The performance is very good (personal opinion) and obviously much more efficient than what you can achieve with SQL. Also SQL is very limited about what and how, Search was made to overcome this limitations and still be very flexible.
The results are very fast, this depends of course on lots of factors, but is usually about 10 milliseconds in the scenarios I've experienced (which are highly complex and large systems).

1) of course you can find all words containing "ant". as I said, it is extremely flexible. In the last chapters you'll find information about how to customize all aspects of matching, as similarity, q-grams, phonetic similarity, language specific tokenizations.

2)this is a bit more complex, best way is to make sure that each "row" of data in the index contains enough information to decide if some group may see it or not. There are other solutions too, and there is a very good example in the code coming with the book about how to implement a filter using completely custom Java code: you don't need to have all info in the index as you could access any other datasource, but that way it would be faster and simpler to query.

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


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