-->
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.  [ 4 posts ] 
Author Message
 Post subject: Luke toolbox not returning simple queries of index! :(
PostPosted: Tue Aug 12, 2008 9:14 am 
Beginner
Beginner

Joined: Tue Aug 12, 2008 9:06 am
Posts: 22
Location: Fort Washington, PA
I've tried reading all over about the different ways to include the annotations for indexing, but no matter what option I run, I do not get any results with the simplest of queries using the Luke Toolbox.

Here is what I'm currently trying with the annotations:
@Entity
@Indexed
@Analyzer(impl = StandardAnalyzer.class)
public class Utterance extends UIDContainer {
@Id
@GeneratedValue
@DocumentId
@Column(name = "UID")
private Integer UID;

@Field(store=Store.YES,index = Index.UN_TOKENIZED)
@Column(name = "Line")
private String line;
...}

This code runs in a test I have written, and once its executed it creates a nice full index that the Luke Toolbox can open and show me, no problem.
I have some test data... I have 2 "documents" which are information inside my database with the text "Fantastic. Any new symptoms?".
Is there any reason why this query wouldn't return anything...?

line: fantastic*

I'm consciously using the org.apache.lucene.analysis.standard.StandardAnalyzer from the Luke "Analyzer to use for query parsing" dropdown to keep the analyzers the same.

Any ideas please?? Thanks so much!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 12, 2008 10:05 am 
Beginner
Beginner

Joined: Tue Aug 12, 2008 9:06 am
Posts: 22
Location: Fort Washington, PA
Ok, I've also tried setting the index to be Index.Tokenized...

While using the StardardAnalyzer I seem to be able to find the things I want... except 1 thing mostly, and maybe its not possible.

For my previous example of a text document "Fantastic. Any new symptoms?", my search would need to have the ability to search for
"any * symptoms" and get this result. I know there is the proximity searching which is close, but my users may not know the limits of how far words are from each other.

I've read the Lucene query syntax and it has this quote: "Lucene supports single and multiple character wildcards within single terms (not within phrase queries). I'm assuming that means that kind of search isn't possible...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 12, 2008 2:45 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
if you do not tokenize the whole sentence is indexed as is, so you cannot find "fantastic*", you might be able to find "Fantastic*"
Tokenizing cuts your sentence into individual words and also apply some normalization (like doing case insensitive search).

For your query, you need to tokenize and do
line:any OR line:fantastic

If you pursue your path with Hibernate Search, you might want to get a copy if Hibernate Search in Action (I'm coauthor). all this is described with examples.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 12, 2008 2:54 pm 
Beginner
Beginner

Joined: Tue Aug 12, 2008 9:06 am
Posts: 22
Location: Fort Washington, PA
Yea I ended up tokenizing and using the WhitespaceAnalyzer so that everything would get into the index word for word. Our whole business is analyzing words, so it was necessary to have everything.

Now I'm at the point where I'm starting to write my searching page.
We're using Hibernate Annotations, Hibernate Search, Spring with MVC, and JSP to render the pages. I'm going to have to write the queries from the user-entered information to query against the multiple indexes that were created, so I'm sure I'll be posting implementation problems at some point, since I'm new to Hibernate altogether.

I just bought that book online and have been printing it out little by little everyday at work. It seems like it has everything I could need and its very well written! Might take me a little bit to get through though considering I've been at work about 12 hours a day. ;-)

Thanks a lot!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.