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?

Était-ce utile?

La 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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top