-->
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.  [ 5 posts ] 
Author Message
 Post subject: [Hibernate Search] AND in queries
PostPosted: Tue May 15, 2007 6:00 am 
Regular
Regular

Joined: Wed Apr 25, 2007 10:29 am
Posts: 110
Location: France
Hello,

I have a question about "AND" in queries :
If my query is (categorie.nom:divers2) AND (titre:h*), I have results.
If it is categorie.nom:divers2, I have no results.

false AND true = false ... what's happen ?

Thank you.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 15, 2007 1:13 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
try and display query.toString() to understand how your query has been parsed

Also note that the boolean view is somewhat misleading
http://mail-archives.apache.org/mod_mbox/lucene-java-dev/200408.mbox/%3C41267191.6060905@apache.org%3E

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 16, 2007 11:16 am 
Regular
Regular

Joined: Wed Apr 25, 2007 10:29 am
Posts: 110
Location: France
Thank you very much.

"categorie.nom:divers2" was parsed in "categorie.nom:divers" ! The "2" disapeared ...

If I use categorie.nom:'divers2' I have the same problem !


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 17, 2007 8:43 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
That's because a parsed query use an Analyzer,
The one you use seems to get rid of numbers

I would warmly recommend Lucene in Action, it explains in depth what is an analyzer, why it's needed, and what are the drawbacks

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 21, 2007 5:14 am 
Regular
Regular

Joined: Wed Apr 25, 2007 10:29 am
Posts: 110
Location: France
Thank you again.

I tried to change Analyser in cfg.xml file, but the problem was not with indexes but with queries :

Code:
new QueryParser("title", new StopAnalyzer());


must be replaced by

Code:
new QueryParser("title", new StandardAnalyzer());


or other analyser.


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