-->
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.  [ 4 posts ] 
Author Message
 Post subject: [hibernate search] search on result return from query.
PostPosted: Mon Aug 04, 2008 1:36 pm 
Beginner
Beginner

Joined: Mon Dec 17, 2007 11:08 pm
Posts: 47
hi,

I having this kind of scenario:

I have an Item which will add to database everyday, and I have a user notification system which is use to notify user daily added item based on user criterion.

say i had 100 notification (from all users), and all I need to do is query 100 times, which is translate each user criterion as a query.

If i doing like this, I have to search all the items instead of just the item add in one day. which is not an ideal approach. (if use date filter, it only apply after get the result, NOT before, hence, it still search all the record before filter).

so If I wanna do like : get the today items ONLY, get all the notifications, translate it to query and query only on today item, is that possible to do that in hibernate search ?

so it will search on specific item only instead of all item. (which may improve performance, i not sure, but sound logical)

any other better idea for this?

kiwi

_________________
happy hacking !


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 05, 2008 6:29 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
if use date filter, it only apply after get the result, NOT before, hence, it still search all the record before filter

why? using a filter correctly you shouldn't have problems.

As another alternative, you could just purge your index (make it empty) at midnight each day; but a Filter should be much more flexible in case you need to make other searches.

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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 05, 2008 11:26 pm 
Beginner
Beginner

Joined: Mon Dec 17, 2007 11:08 pm
Posts: 47
Hi, thanks for reply.

Due to a lot of item will add to database everyday, the index will be getting bigger. (mean the search will take so far so long time to complete.)

So I though that if the query is apply to certain item ONLY (e.g. today add item, which is filter by date field) instead of ALL the item, then only do a filter, maybe the performance will be better. (not sure is possible to do in hibernate Search)

this is just of my though, maybe i was wrong :)

also, I will keep the index file instead since I too lazy to do make it run another schedule task :))

kiwi
[/img]

_________________
happy hacking !


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 07, 2008 9:53 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
If your query is purely Lucene, I would not bother much about performance. Try the "brute" force (use a filter to reduce items to today's changes). If and only if this happens to be slow, then you can think of alternatives. But I doubt you will need to.

_________________
Emmanuel


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