I index a boolean field like this:
[Field(Index.UnTokenized, Store = Store.No)]
public virtual bool P { get; set; }
My query code looks like this:
public IList<MappedSequence> Query(string term, out int total, int page, int pageSize)
{
if (term.ToString().Equals("") == false)
{
var parser = new MultiFieldQueryParser(Lucene.Net.Util.Version.LUCENE_29, new[] { "Query" }, new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29));
Query query = parser.Parse(term);
IFullTextSession session = Search.CreateFullTextSession(this.Session);
IQuery fullTextQuery = session.CreateFullTextQuery(query, new[] { typeof(MappedSequence) });
total = fullTextQuery.List<MappedSequence>().Count();
return fullTextQuery.List<MappedSequence>().Skip((page - 1) * pageSize).Take(pageSize).ToList<MappedSequence>();
}
else
{
total = 0;
return null;
}
}
This works fine for other index field but not for the boolean ones. I tried all sorts for term:
"P:\"TRUE\""
"P:\"1\""
without success. Any ideas what could be wrong?
BTW is there a more efficient way to determine total?
Thanks!
Christian
It appears that if I use Tokenized for indexing it works.
Christian