0

I have title search with Lucene .net and facing problem with LIKE clause search.

I have tried below terms but it is matching whole word.

query.Add(new TermQuery(new Term("title", word.ToLower())), BooleanClause.Occur.MUST);

Also tried

query.Add(new TermQuery(new Term("title", word.ToLower())), BooleanClause.Occur.SHOULD);

Any idea how to apply LIKE clause?

k-s
  • 2,192
  • 11
  • 39
  • 73
  • If you were looking for SQL-type LIKE syntax, there are questions for that already in SO: http://stackoverflow.com/questions/3307890/how-to-query-lucene-with-like-operator – mindas Jan 14 '14 at 08:36
  • Need more clarification. What do you mean with "LIKE clause" ? – fatih Jan 14 '14 at 10:42

1 Answers1

0

I would guess you are probably looking for either Prefix or Wildcard queries.

In general, I'd recommend getting some level of understanding of the instantiable subclasses of Query, listed here.

femtoRgon
  • 32,893
  • 7
  • 60
  • 87