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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:03:40+00:00 2026-05-27T11:03:40+00:00

Sorting can be done on the score of the document, or on any multiValued=false

  • 0

Sorting can be done on the “score” of the document, or on any multiValued=”false” indexed=”true” field provided that field is either non-tokenized (ie: has no Analyzer) or uses an Analyzer that only produces a single Term (ie: uses the KeywordTokenizer)

docs:- http://wiki.apache.org/solr/CommonQueryParameters#sort

My original schema is (You can consider the following is a GROUP-BY) :-

  • products (id, unique)
    • users who make some comments(multiValued)
    • last_comment_date for each user (multiValued, one user can make multiple comments, but only the last comment date is captured)

If sorting on multiValued is allowed,
I can easily get list of the products commented by certain users,
then sort by last_activity_date.

However, it does not work.
The workaround I have currently is to reverse the schema to :-

  • user + product (as id, unique)
  • user (single value)
  • last_comment_date
  • products

Which mean I (sort of) manage to get list of the products commented by certain users,
order by last_comment_date,
of course it lead to duplication of products
as product will appear in each of the user’s comment.

Any suggestion to simulate a group-by effect.

Between, I using solr 3.1.
Field collapsing does not apply.

  • 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-27T11:03:41+00:00Added an answer on May 27, 2026 at 11:03 am

    Sorting by a multi-valued field is not something that is just pending to do or can be patched.

    It can’t be possibly done because it simply doesn’t make any sense.

    The way to do this is to have a single-valued field (populated at index-time with the last date) per document, then sort on that. I.e. when indexing traverse the list of users with their last activity date, find the latest date, and assign it to the document’s last-activity-date field.

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

Sidebar

Related Questions

I want to have a model with calculated fields that I can apply sorting
Is there a resource that i can find different variations of searching, sorting and
http://jsfiddle.net/JeaffreyGilbert/VkghS/ Currently sorting between rows can be done by dragging barWrap (grey). To move
Normally sorting based on keys and then iterating a hash can be done as
How can I implement STL map sorting by value? For example, I have a
Which Doxygen option can completely disable sorting members by type (Private / Public /
I'm new to Python's custom sorting capabilities, but I'm sure the following can be
How can it be done in most simply way to write (or maybe there
I need to remove the sorting arrow from a column header. This can be
I have a problem that I have been thinking about, but I can't really

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.