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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:24:10+00:00 2026-06-16T00:24:10+00:00

I am writing a request handler for SOLR 4.0 and i am trying to

  • 0

I am writing a request handler for SOLR 4.0 and i am trying to get all unique values of a field of type tlong (field is indexed of course).

Whenever i try to get all unique terms for a tstring field i can simply use the following code:

DocTermsIndex sourceIndex=FieldCache.DEFAULT.getTermsIndex(searcher.getAtomicReader(), "txtField")      
TermsEnum terms=sourceIndex.getTermsEnum()

Then i can iterate over all unique terms, execute utf8ToString() on every term and it is working fine.

When i try to do the same for a tlong field i get garbled results – number of terms returned is different from the number of unique values and the values themselves do not represent Long in any way (different value lengths etc..).

Is there another way of obtaining a list of unique values for a tlong field?

  • 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-16T00:24:11+00:00Added an answer on June 16, 2026 at 12:24 am

    Ok, i found it out. If anyone is interested: longs seem to use different type of encoding in Solr 4.0, so we can approach them as ordinary strings as in the code above but later we have to use a different parser to convert term value to long:

     FieldCache.NUMERIC_UTILS_LONG_PARSER.parseLong(term)
    

    It seems to throw an exception when no more elements are present. As for now it is working fine.

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

Sidebar

Related Questions

I'm writing a Web API service and trying to return a (400) Bad Request
I'm writing a simple request handler to return a pair of css files. Using
I am writing request specs ... I use Capybara... And I am in trouble
I am writing a C++ application and would like to request several data files
While writing code, it is pretty common to request a page with an appended
I'm writing a server running as a Windows service that by request invokes Firefox
I am writing a High Performance ASP.NET Json API with soon > 1000 Request/Second.
I'm writing user client for blog system. This is how I perform request var
I'm not going to use other module like request , how about writing this
I'm writing a client for an asp.net handler that processes and sends notifications to

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.