Thelinh Truong
Thelinh Truong

Reputation: 574

Escape forward slash character in Hibernate Search / Lucene

I'm using Hibernate search 4.2, Lucene 3.6.

I have following column in the domain:

@Column(name = "summarycontent")
@Field(index = Index.YES, store = Store.YES)
public String getSummarycontent() {
    return this.summarycontent;
}

In database I have data: abcdef dsfasdf 14/12 fdfdf.

When performing the query query: +summarycontent:14/12~0.3 it returns no result.

I think it is because Lucene hasn't escaped forward slash character in the word "14/12".

Please help me to handle Lucene search with forward flash character in Hibernate.

Upvotes: 1

Views: 1058

Answers (1)

Mark Leighton Fisher
Mark Leighton Fisher

Reputation: 5703

You need to look at the different tokenizers available in Lucene, as I think both the Classic and Standard tokenizer throw away '/' during tokenizing.

Upvotes: 1

Related Questions