lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deeksha Sharma <DSha...@flexerasoftware.com>
Subject Sort by field Type String
Date Thu, 16 Feb 2017 22:55:01 GMT
Hi,

I have an index with a field that looks like below:
<field name="version"        type="string" indexed="true" stored="true" required="true"/>

Below are some examples of version values:

        "version":"2.0.5"},
      {
        "version":"1.10-b04"},
      {
        "version":"2.3.3"},
      {
        "version":"2.0-M5.1"},
      {
        "version":"0.4.0"},
      {
        "version":"2.1.0-M01"},
      {
        "version":"2.0.3"},
      {
        "version":"4.2.2"},
      {
        "version":"5.2.12.Final"},
      {
        "version":"1.7.4"}]
     }

As per the instructions in documentation here: https://cwiki.apache.org/confluence/display/solr/Common+Query+Parameters#CommonQueryParameters-ThesortParameter

When I query solr, I want to sort the results by this version. When I in my query sort=version
asc it gives me some weird result (shown below):


{
  "responseHeader":{
    "status":0,
    "QTime":0,
    "params":{
      "q":"*:*",
      "indent":"true",
      "fl":"version",
      "sort":"version asc",
      "wt":"json"}},
  "response":{"numFound":5249127,"start":0,"docs":[
      {
        "version":"\"1.0.0"},
      {
        "version":"\"1.0.0"},
      {
        "version":"$%7Bcucumber-jvm.version%7D"},
      {
        "version":"$%7Bcucumber-jvm.version%7D"},
      {
        "version":"$%7Bcucumber-jvm.version%7D"},
      {
        "version":"$%7Blog4jplugin.version%7D"},
      {
        "version":"$%7Blog4jplugin.version%7D"},
      {
        "version":"$%7Blog4jplugin.version%7D"},
      {
        "version":"$%7Blog4jplugin.version%7D"},
      {
        "version":"${env.VERSION}"}]
  }}

Can someone please help?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message