-->
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: Field configured to be filtered with LowerCaseFilterFactory?
PostPosted: Fri Jul 20, 2012 11:48 am 
Newbie

Joined: Mon Dec 19, 2005 9:18 pm
Posts: 17
Location: Brussels, Belgium
I have a brand name field that is configured to be tokenized as a keyword and lowercased:

Code:
@AnalyzerDef(name="name_analyzer", tokenizer = @TokenizerDef(factory = KeywordTokenizerFactory.class), filters=[@TokenFilterDef(factory = LowerCaseFilterFactory.class)])
class Make {
    @Field(index = Index.UN_TOKENIZED, store = Store.YES)
    @Analyzer(definition="name_analyzer")
    String name
}


But when I look at the index with Luke, names are not lowercased. So when I query "caterpillar" instead of "Caterpillar", I can't find instances whose name is "Caterpillar".

What did I do wrong?

_________________
Sébastien Arbogast


Top
 Profile  
 
 Post subject: Re: Field configured to be filtered with LowerCaseFilterFactory?
PostPosted: Mon Jul 23, 2012 4:36 am 
Hibernate Team
Hibernate Team

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

you need to tokenize the input or at least use the option _index = Index.TOKENIZED_. This will then trigger the use of your tokenizer/analyzer chain. Given that you are using a keyword tokenizer your input will not be broken up either way (only lowercased).

--Hardy


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.