Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4063162
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:41:26+00:00 2026-05-20T15:41:26+00:00

I index a boolean field like this: [Field(Index.UnTokenized, Store = Store.No)] public virtual bool

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T15:41:27+00:00Added an answer on May 20, 2026 at 3:41 pm

    It appears that if I use Tokenized for indexing it works.

    Christian

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Could I add a boolean field to my database data called something like updated
If my index contains three boolean fields: a, b and c... I would like
I'm using a simple mysql LIKE query like this: SELECT * FROM myTable WHERE
I have a user table that has many columns, it looks roughly like this:
I would like to ask what's the use of System.property in this source code?
My index.html page for my project needs some Ruby code so I need to
How to set index of a multiple select object to be selected when mouse
Somehow my index.php file at the server get modified. As a result, when I
In my index view file i have: $this->widget('zii.widgets.CListView', array( 'dataProvider'=>$dataProvider, 'itemView'=>'_view', 'ajaxUpdate'=>false, )); A
I have a bunch of boolean options for things like acceptable payment types which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.