tags:

views:

41

answers:

2

Hi!

I am using Hibernate. I am looking for a free text engine.

Before I investigate into it I need your experience.

I have in my applications user, role and object table. Where a user is connected to one or more roles, and a role is connected to one or more objects.

In my free text search, the user can reach only data that he is allowed to watch by object table.

Can Hibernate search help me with it?

A: 

These are two separate problems:

  • restricting which content an user is able to search within
  • actually searching the content

While for the second problem you can easily use Hibernate Search (that is just Apache Lucene with a bit of integration), for the first one you should concentrate on selecting the right content you want to search before searching it with lucene.

Jack
so this was my question - how can I combine them in an indexed way? since I don't want to create a query using where for each role! and i don't want to bring all the data and search inside. I need to create index for secured data..
Odelya
I think you can filter them restricting the entity on which you will do your search..
Jack
+1  A: 

Check this out:

http://lucene.apache.org/java/2_4_0/api/org/apache/lucene/search/Filter.html

I think this is the proper way to implement what you want. Don't really know how is this integrated into hibernate-search, but hopefully there is a way to add a filter to a query somehow.

Later edit:

it looks like there is:

http://docs.jboss.org/hibernate/stable/search/reference/en/html/search-query.html#query-filter

Toader Mihai Claudiu