-->
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: [Hibernate Search] Problem indexing alphanumeric fields
PostPosted: Tue Jul 10, 2007 9:45 am 
Newbie

Joined: Tue Jul 10, 2007 9:20 am
Posts: 2
Hello,

I´m a newbie in hibernate search and I´m getting some trouble on searching for alphanumeric fields.

I have a class with a String attribute named 'code':


Code:
    @Field(name="code", index=Index.TOKENIZED)
    private String code;


Searching for regular string values it works fine, and I get correct results when this attribute is set, for example, as:

"project" (query="+code:project")
"project one" (query="+code:'project one'")
"project 1" (query="+code:'project 1'")

This makes me think the mapping is correct.

But, when I just put numbers and letters together in the attribute value, it just doesn´t work, as:

"proj1" (query=+code:proj1), (query=+code:'proj1') for example.
"proj1test" (query=+code:proj1test)

I have already tried Index.TOKENIZED, Index.UN_TOKENIZED and Index.NO_NORMS, but it didn´t work.

Thanks in advance.

Best regards,

Diogo


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 10, 2007 10:28 am 
Regular
Regular

Joined: Wed Apr 25, 2007 10:29 am
Posts: 110
Location: France
You should try another analyzer. I use StopAnalyser (it cut a String in tokens, separated by a space).

Moreover, I think you must use double quotes in query like "word1 word2".


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.