-->
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.  [ 3 posts ] 
Author Message
 Post subject: Searching using HibernateSearch is slow
PostPosted: Tue Dec 04, 2007 3:40 pm 
Newbie

Joined: Sat Dec 30, 2006 3:07 pm
Posts: 16
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

3.2.5 ga

Mapping documents:
Annotations 3.3.0 GA

Name and version of the database you are using:

mysql 5.0


Lucene 2.2.0


I am using HibernateSearch + lucene to perform text based searches.

the search executes about 1query / second (averaged over 15,000 queries), and I am wondering if this is to be expected speed or not.

The index has about 10,000,000 documents.

Here are the fields that I am searching on

Code:
   
    @Field(name="albumtitle", index= Index.TOKENIZED, store= Store.YES)
    private String title;

    @Field(name="artist", index= Index.TOKENIZED, store= Store.YES)
    private String artist;

    @Field(name="title", index= Index.TOKENIZED, store= Store.YES)
    private String title;


Here is an example query


artist:(acoustic alchemy) AND albumtitle:(arcanum) AND title:(mr. chow)


I have hard coded that it would return 1 result to see if that helps.

do you have any recommendations on how to make this a little faster?

I am just not sure how to tell if it is slow because of the index, or the query or if this speed is to be expected? Is there a way to group the queries so that it might be faster?

Thanks

Kal


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 05, 2007 3:23 pm 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
I guess slow is really relative. As a gut feeling I would also say that 1 query per second is slow, but what kind of hardware are you running on? Especially how much RAM do you have and how much do you actually allocate for the JVM? Do you use the default heap size or do use the '-Xmx' and '-Xmx' when starting the JVM?

Another important question is in which configuration you use Hibernate Search. Do you use a FSDirectoryProvider or a RAMDirectotProvider. The latter should perform better provided you have sufficient RAM.

Another factor to consider could be the merge factor. Generally speaking a lower value should be better - see http://www.hibernate.org/hib_docs/search/reference/en/html_single/#lucene-indexing-performance

If your objects are quite heavy weight and your searches usually return a great number of objects database access could become a bottleneck. In this case projections might be a solution: http://www.hibernate.org/hib_docs/search/reference/en/html_single/#lucene-indexing-performance
(even this seem not to apply to your case)

Independent from Hibernate Search there are many other Lucene specific performance considerations. A good place to start is: http://wiki.apache.org/lucene-java/BasicsOfPerformance.

I hope this helps you getting started looking into the right direction.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 05, 2007 8:31 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Well, it might be as simple as you don't use pagination and return a lot of useless objects or you haven't tuned the batch size in the returned objects. Check the HSearch doc, some of this is explained AFAIR

_________________
Emmanuel


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