Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top