I've read and tried many of the indexing options available, and still aren't quite getting what I need.
For example, if I have database table called "tblUtterance", with a column name "Line", the following is how I'm indexing...
Code:
Session session = this.hibernateTemplate.getSessionFactory().openSession();
FullTextSession fullTextSession = Search.createFullTextSession(session);
fullTextSession.getTransaction().begin();
List<Utterance> utterances = session.createQuery("from Utterance").list();
for (Utterance utterance : utterances) {
fullTextSession.index(utterance);
}
And this is my Utterance.java pojo. I also have this class extending another class where the @DocumentId is declared, so it is there as well.
Code:
@SuppressWarnings("serial")
@Entity
@Table(name = "tblUtterance", schema = "dbo")
@Indexed
@Analyzer(impl = WhitespaceAnalyzer.class)
public class Utterance extends UIDContainer {
@Field(store = Store.YES, index = Index.TOKENIZED)
@Column(name = "Line", nullable = false, length = 4000)
private String line;
In the Luke tool, if a document that was indexed (a row in my table) is the following:
"Fine. How are you?"
I want to be able to search for the word "Fine" and have this utterance as a result, but nothing shows up. The only way it shows up is if I type the entire thing verbatim. Any ideas on how to have a true "full-text" index and search??
Thanks!