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 8571795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:51:38+00:00 2026-06-11T18:51:38+00:00

I am using Lucene .net to index eml file with eml content, id and

  • 0

I am using Lucene .net to index eml file with eml content, id and localdate field and later firing a daterange query on localdate to get the list of eml id satisfying the localdate to and from query. I have scanned about 8000 eml file and making a search, which works fine for limited set of queries. If fire a query by keeping from date less than 30 April, 2010 then query fails if the from date is after 30 April, 2010 then the query return me the result. I am really surprised to see the behaviour, the query should work with all date range. Following is the piece of code used.

DateTime from = DateTime.Parse("3/30/2010 11:00:00 AM");// DateTime.Now.AddMonths(-12);

DateTime to = DateTime.Now;

String sFrom = DateTools.DateToString(from, DateTools.Resolution.SECOND);  

String sTo = DateTools.DateToString(to, DateTools.Resolution.SECOND);

Lucene.Net.Index.Term date1 = new Lucene.Net.Index.Term("LOCALDATE", sFrom + "*");

Lucene.Net.Index.Term date2 = new Lucene.Net.Index.Term("LOCALDATE", sTo + "*");

Lucene.Net.Search.Query dateRangeQuery = new Lucene.Net.Search.RangeQuery(date1, date2, true);

Hits hits = searcher.Search(dateRangeQuery);

It throws the following exception on Search:

System error.

at Lucene.Net.Search.BooleanQuery.Add(BooleanClause clause)
   at Lucene.Net.Search.BooleanQuery.Add(Query query, Occur occur)
   at Lucene.Net.Search.RangeQuery.Rewrite(IndexReader reader)
   at Lucene.Net.Search.IndexSearcher.Rewrite(Query original)
   at Lucene.Net.Search.Query.Weight(Searcher searcher)
   at Lucene.Net.Search.Hits..ctor(Searcher s, Query q, Filter f)
   at Lucene.Net.Search.Searcher.Search(Query query, Filter filter)
   at Lucene.Net.Search.Searcher.Search(Query query)
   at LuceneIndexTestApp.Form1.Search(String text, IndexSearcher searcher, QueryParser parser) 

Any help will be appreciated!!

Thanks,
Haseena

  • 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-06-11T18:51:39+00:00Added an answer on June 11, 2026 at 6:51 pm

    The problem was solved using BooleanQuery.SetMaxClauseCount(Int32.MaxValue);

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

Sidebar

Related Questions

I have a single XML file that I want to index using Lucene.NET. The
I am using a Lucene.Net index and want to give the user an option
I'm trying using NHibernate.Search to get Lucene.NET Score through projections. My domain object implements
I want to search a Lucene.net index for a stored url field. My code
My application uses Lucene.NET to index various text files. Since each text file is
I am trying to get SpellChecker setup using Lucene.NET, it all works fine other
I am using a read-only Lucene.NET index in a web application and creating a
I've found how to sort query results by a given field in a Lucene.Net
I am using Lucene.net to index a product catalog. I was profiling my searches
I'm using Lucene.NET, when I try to index for example the following text: In

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.