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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T19:20:38+00:00 2026-05-21T19:20:38+00:00

I use the following statement to index a date: luceneDoc.add(new NumericField(key).setLongValue(date.getTime())); I also use

  • 0

I use the following statement to index a date:

luceneDoc.add(new NumericField(key).setLongValue(date.getTime()));

I also use statements as follows to add text properties:

luceneDoc.add(new Field(key, value, Field.Store.YES, Field.Index.ANALYZED));

Then I perform a text property query:

author:hans

This works perfect. But when I perform a range query, nothing gets returned:

my-date-property:[20100101 TO 20110101]

What am I missing here?

I had a look at the index with Luke, I see all my text property for a document but the date properties only appear in the overview page… maybe that is normal.
I actually DO SEE the date properties if I add it like this:

NumericField field = new NumericField(key, Field.Store.YES, true);
field.setLongValue(date.getTime());
luceneDoc.add(field);

But: the query still does not work! Maybe it only works from Java with the Query Builder? I have not tried out that. But it would be great if the text query would work too. ANY IDEA???

  • 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-21T19:20:39+00:00Added an answer on May 21, 2026 at 7:20 pm

    If you want a range query to work with dates in the form of YYYYMMDD, then index your date like this:

    String dateString = DateTools.dateToString(date, Resolution.DAY);
    luceneDoc.add(new Field(key, dateString, Store.YES, Index.NOT_ANALYZED));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What should I use in the following statement? Include or required. if(a ==b){ require
I am looking for the SQL syntax to use HAVING in the following statement:
My select statement in PHP is select * from table; I use the following
In the below sql statement i get the following error Cannot use an aggregate
I use the following jquery statements, $(.resultsdiv:odd).css(background-color, #fff); $(.resultsdiv:even).css(background-color, #EFF1F1); $('.resultsdiv').hover(function() { $(this).css('background-color', '#f4f2f2');
I use the following jquery statements but i get error in this function onGetDataSuccess(result)
I use the following jQuery statements and I am getting the error, jQuery.parseJSON is
I use the following the jquery statements to call my php controller function, it
With the following statement (attempting to grant a role permissions to use a view),
I keep getting Notice: Undefined index: action When I use the following code. I

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.