-->
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: Using Hibernate Search (Lucene) to query a term with no spac
PostPosted: Mon Nov 04, 2013 10:52 pm 
Newbie

Joined: Mon Nov 04, 2013 10:51 pm
Posts: 1
I have a Movie class with a name field. I want to match against movie names that have spaces in it for query terms with no spaces.

For example: I want the movie with name Toy Story to be in the results when the search term is toystory.

How to do I write my Hibernate Search DSL Query?


Top
 Profile  
 
 Post subject: Re: Using Hibernate Search (Lucene) to query a term with no spac
PostPosted: Mon Nov 11, 2013 6:35 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
The query aspect is easy: just use a keyword query, but you need to specify indexing time options to be able to do this.

Make sure that when the movie title is indexed you index both the value "Toy Story" and the combination "ToyStory". You probably want to index the second kind of value in a separate field name, so that you can target either or both fields during a query.

_________________
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.