-->
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 : indexed in UPPER CASE
PostPosted: Tue Jan 06, 2009 4:42 am 
Beginner
Beginner

Joined: Tue Feb 12, 2008 3:53 pm
Posts: 38
Hi,
I use HIBERNATE SEARCH and I indexed a field "dataEntryOwner" of a class "dataEntryValue" :

Code:
@Indexed
public class DataEntryValue {
.........
.........
@Field(index=Index.UN_TOKENIZED)
public String getDataEntryOwner() {
   boolean test = false;
   String result = "";
   DataEntryOwner dataEntryOwner = null;
   Set<DataEntryOwner> dataEntryOwners = itemData.getItemGroupData().getFormData().getDataEntryOwners();
   Iterator<DataEntryOwner> it = dataEntryOwners.iterator();
   while (it.hasNext() && test==false) {
      dataEntryOwner = it.next();
      if (dataEntryType.equals(dataEntryOwner.getDataEntryType())) {
         result = dataEntryOwner.getUser().getUsername();
         test = true;
      }
   }
   return result;
}
........
........
}



I chose the default Analyzer, so it is the StandardAnalyzer. According to HIBERNATE SEARCH IN ACTION, everything is indexed in lower case. Everything is fine for 95% of my indexed properties. But my "dataEntryOwner" property is indexed in upper case. I don't understand why that property is indexed in upper case ? Thank-you in advance for your help


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 07, 2009 7:21 am 
Hibernate Team
Hibernate Team

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

in your example you are using @Field(index=Index.UN_TOKENIZED) . Indexing a field un-tokenized means indexing as is without applying any analyzers at all. You should use Index.TOKENIZED.

--Hardy


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 08, 2009 1:05 am 
Beginner
Beginner

Joined: Tue Feb 12, 2008 3:53 pm
Posts: 38
Thank you very much Hardy for your answer


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.