-->
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: How to get this correctly analyzed and searched ?
PostPosted: Wed Apr 14, 2010 3:39 am 
Beginner
Beginner

Joined: Sun Jul 12, 2009 9:53 am
Posts: 21
Hi all,

i have a hard thing; i need index a class, that contains some fulltext searchable properties. I annotate them with
Code:
@Field(index = Index.TOKENIZED, store = Store.YES)


But now, there is also a field (part of its composite primary key) containing strings like "CAN-RT-2213".

What do I have to do so that a search request for "CAN-RT-2213" brings this result and if he searches for "CAN-RT" this should also work ?
Currently I just replace the "-" by a space but that brings way too much results.

In addition - how to i enable to boostfactor within the search results ? I have it defined in my class but it does not seem to get applied.


Top
 Profile  
 
 Post subject: Re: How to get this correctly analyzed and searched ?
PostPosted: Thu Apr 15, 2010 6:37 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Quote:
Currently I just replace the "-" by a space but that brings way too much results.

that's because the query is using "OR" on the different terms; see this post.

Quote:
What do I have to do so that a search request for "CAN-RT-2213" brings this result and if he searches for "CAN-RT" this should also work ?

if you know that's the format, you could write a custom bridge and use three different fields where you add it like this:
Code:
codeType1="CAN"
codeType2="CAN-RT"
codeType3="CAN-RT-2213"

when you parse a query, you select the field to be searched on according to the format of the searchstring; this should perform very well as it's an exact match on a single term. There's a similar bridge in the examples of reference documentation dealing with day, month, year parts.

Another approach is to split them in different fields:
Code:
codeType1="CAN"
codeType2="RT"
codeType3="2213"

In this case you can apply some cool trick using filters to have partial result caching.

_________________
Sanne
http://in.relation.to/


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.