views:

582

answers:

2

Hi, I need to index bi-grams of words (tokens) in Lucene. I can produce n-grams and than index them, but I am wondering if there is something in Lucene which will do this for me. I found out that Lucene indexes only n-gram of chars. Any ideas?

A: 

Depending on why you need to index bi-grams, SpanQuery and/or SnowballAnalyzer may be helpful.

Hank Gay