-->
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: hibernate-search troubles
PostPosted: Thu Mar 06, 2008 6:25 pm 
Newbie

Joined: Tue Feb 12, 2008 3:51 am
Posts: 6
Hi everybody. I'm using hibernate-search 3.0.0.GA and found some strange things.

By example, if i run search with query, which contatins special characters (/, \, {, }, * and so on), and i have records with these characters in my DB , then i get empty search result. Why? Before search i call "QueryParser.escape(query)", so all special chars must be escaped after this.

By the way, the * character is some kind of magical sign. If i want to search records, which contains *** (three asterisks)(by example: fu***ng, pet***g and so on), i must call queryParser.parse with following parameter: *\*\*\** , right? 3 escaped asterisks and leading and ending asterisks for wildcarding. But this query causes some kind of "broadcast" query and i have "BooleanQuery:TooManyClauses" exception. Why? What should i do to search these kind of words? By the way, if i enter *** in Hibernate Forum search, i think, it crashes, because i waited about 5 minutes for search results, but nothing happens. :)

And another one thing. If i run search with word "and", search engine just ignore it. Is that some special word? How can i disable it special meaning?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 07, 2008 2:15 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

I might not have the answers for all your questions, but maybe a few. Generally I have the impression that your problems are more Lucene related than Hibernate Search. I recommend you to read some of the Lucene documentation.

First of all this http://lucene.apache.org/java/docs/queryparsersyntax.html. For example, the boolean and operator is AND (all CAPS) or &&. And yes, the backslash escapes the wildcard functionality of *. However, if you start a query with a wildcard star as in your example it is quite easy to get a TooManyClausesEsception. This topic and some workarounds are explained here http://wiki.apache.org/lucene-java/LuceneFAQ#head-06fafb5d19e786a50fb3dfb8821a6af9f37aa831.

Last but not least - check your Lucene index via Luke to see if the special characters got indexed the way you expected (http://hibernate.org/440.html). Some analyzers might remove these special characters when indexing. Are you indexing your data tokenized or un-tokenized?

--Hardy


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 07, 2008 4:16 am 
Newbie

Joined: Tue Feb 12, 2008 3:51 am
Posts: 6
hardy.ferentschik wrote:
Hi,

I might not have the answers for all your questions, but maybe a few. Generally I have the impression that your problems are more Lucene related than Hibernate Search. I recommend you to read some of the Lucene documentation.

First of all this http://lucene.apache.org/java/docs/queryparsersyntax.html. For example, the boolean and operator is AND (all CAPS) or &&. And yes, the backslash escapes the wildcard functionality of *. However, if you start a query with a wildcard star as in your example it is quite easy to get a TooManyClausesEsception. This topic and some workarounds are explained here http://wiki.apache.org/lucene-java/LuceneFAQ#head-06fafb5d19e786a50fb3dfb8821a6af9f37aa831.

Last but not least - check your Lucene index via Luke to see if the special characters got indexed the way you expected (http://hibernate.org/440.html). Some analyzers might remove these special characters when indexing. Are you indexing your data tokenized or un-tokenized?

--Hardy

Thanks a lot for your reply. I will try what you say.
PS. I'm indexing my data with "tokenized" flag.


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.