-->
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: Hibernate Search: efficient global search?
PostPosted: Wed Nov 18, 2015 10:42 am 
Newbie

Joined: Wed Nov 18, 2015 10:02 am
Posts: 7
Our software system uses Hibernate Search to index relatively large object model.

We would like to implement a “global search” with following features:
* The user gives an arbitrary query string.
* The query string is matched against all indexed properties of all entities.
* If an entity property contains the query string somewhere in it, the entity is considered to match.
* We report not only matching entities, but also the entity property that caused the match.

As Hibernate search will create a field for every indexed entity property (/ database column), the amount of fields in an index grows in our case to hundreds. So far we haven’t found a way to do this query efficiently.

Is there a standard way to implement this kind of “global search”?


Top
 Profile  
 
 Post subject: Re: Hibernate Search: efficient global search?
PostPosted: Thu Nov 26, 2015 6:09 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
The search on all fields it should be as easy as targeting all fields of the index.

The main complexity of your request is to be able to tell which property actually matched. You could try to extract that information by also having it return an "explanation" object?

Code:
query.setProjection(
    FullTextQuery.THIS
    FullTextQuery.EXPLANATION);


That will have the query return elements of type Object[], with two elements in each: the entity (as usual), and a description of how each different field matched the 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.