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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:34:47+00:00 2026-06-07T02:34:47+00:00

During storing date field into SOLR, I convert Date() to toISOString() and it accepts.

  • 0

During storing date field into SOLR, I convert Date() to toISOString() and it accepts. I tried storing using toUTCString, but it fails.

Now while searching, I am sorting based on date, I do get result, but these are not sorted in an descending order, rather I get it in mixed order.

I tried specifying a range, using [NOW-1YEAR/DAY TO NOW/DAY+1DAY], but the result is still the same. First I get 6 days old document, then 30min old doc and then 2 months old doc.

what should be the right approach ?

EDIT:
Here is the date field that i added in schema.xml

   <field name="message_date" type="date" indexed="true" stored="false" />

and here are the parameters, I am sending during each search,

query = "*:*";
var options = {
            fq: '{!geofilt}',
            sfield: 'location',
            pt: latitude+','+longitude,
            d: 10,
            sort: ["message_date desc", "geodist() asc"],
            start: 0,
            rows: 10
        }

solrclient.query(query, options, function(err, solrRes){
....
});

This is javascript in the server side, node.js code.

  • 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-07T02:34:49+00:00Added an answer on June 7, 2026 at 2:34 am

    The above code is fine and it is working. Problem was, after retrieving the result from SOLR, I do a finer search in my database to get more details and that was not sorted.
    So sorted the result from Mongodb after retrieving the result from SOLR and that worked.

    Using nodejs and the solr module is, https://github.com/gsf/node-solr

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

Sidebar

Related Questions

So far during my site development I have been storing all my jQuery functions
During the development I experience unhandled exceptions at random occasions, but mostly after closing
I am trying to get a Date type field from the entity and I
Toolkit I'm trying to document my classes but i'm using a self var to
I have a form contains text fields,a textView and 2 switches.Now I am using
I have a string that is a valid date but it is a string
I have a problem during an insert in Oracle using Java and JDBC. The
I am developing a project that has a DateTime field. In it I'm using
I have code to parse Date Field only if String is not null or
I have two choices of storing date and time in my database. Generate the

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.