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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:06:13+00:00 2026-06-12T04:06:13+00:00

We are currently using lucene 2.3.2. We pad integers with leading zeroes and index

  • 0

We are currently using lucene 2.3.2. We pad integers with leading zeroes and index so that we can support range queries as well. We are working towards upgrading to lucene 3.4 and want to use NumericRangeQueries. We also want to support non-range queries on numeric fields. Is there any way to use number field and support in-list kind of queries on numeric fields in lucene.

request_id:(123, 124, 253)

I know that above query can be translated to

request_id:[123 TO 123] OR request_id:[124 TO 124] OR request_id:[253 TO 253]

But query will be too long when user gives a huge list. Is there any way to get the best of both approaches? (performance benefits on range queries from indexing as numeric fields and supporting in-list queries without translating these to pseudo range queries)

  • 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-12T04:06:14+00:00Added an answer on June 12, 2026 at 4:06 am

    It appears that you have to use org.apache.lucene.util.NumericUtils to accomplish this, such as:

    new TermQuery(new Term("field",
    NumericUtils.intToPrefixCoded(myInt)));
    

    Although, from what I understand, it should be optimized to handle range queries with equal min and max, so the example query you provided should not incur any more overhead than the example here.

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

Sidebar

Related Questions

I'm using Zend_Search_Lucene, the PHP port of Java Lucene. I currently have some code
Just a quick pre-emptive question before we start to seriously investigate using Lucene. Currently
I have a class that implements Runnable and am currently using an Executor as
Situation:I have an ASP .NET application that will search through docs using Lucene. I
We are currently using Lucene 2.3.2 and want to migrate to 3.4.0 . We
I've got an index that currently occupies about 1gb of space and has about
Need to create a Google like suggestions using Lucene.net. I am currently using ShingleAnalyzerWrapper
I'm currently using the snapshot version on lucene 4.0 (because of bm25), I was
I'm currently using Apache Tomcat 5.5.16 to serve a Lucene-based search API. Lately I've
Currently I am using custom made Java search engine. This Java engine uses Lucene

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.