aneesh
(Arcadix Infotech Pvt.Ltd)
November 6, 2017, 5:13am
1
After Sort I am getting result like this
Adfgsdh
Bhdfaf
Dbsdf
Z Edfghf
Mkjldfhd
Zdhgj
Word Z Edfghf came on wrong place. When I removed space it came on proper place
ElasticsearchResponse objElasticResponse = objClient.Search(strIndex, strType, @"
{
""from"": 0,
""size"": 10000,
""sort"" :[
{ ""Name"": { ""order"" : ""asc"" , ""missing"" : ""_last"" , ""unmapped_type"" : ""long""} }
],
""query"": {
""bool"": {
""must"": [
],
""should"":[
]
}
}
}");
warkolm
(Mark Walkom)
November 6, 2017, 5:34am
2
What's the mapping on the field?
aneesh
(Arcadix Infotech Pvt.Ltd)
November 6, 2017, 6:06am
3
"Name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
},
"fielddata" : true
}
warkolm
(Mark Walkom)
November 6, 2017, 9:33pm
4
Use the Name.keyword
field and you should be ok.
aneesh
(Arcadix Infotech Pvt.Ltd)
November 7, 2017, 4:39am
5
ElasticsearchResponse objElasticResponse = objClient.Search(strIndex, strType, @"
{
""from"": 0,
""size"": 10000,
""sort"" :[
{ ""Name.keyword"": { ""order"" : ""asc"" , ""missing"" : ""_last"" , ""unmapped_type"" : ""long""} }
],
""query"": {
""bool"": {
""must"": [
],
""should"":[
]
}
}
}");
Query like this
aneesh
(Arcadix Infotech Pvt.Ltd)
November 10, 2017, 9:45am
6
Hi.
Sorting is still not coming as expected
AbcEdf
Abc Zgdfg
if sort above, Second word is coming first because of that space
aneesh
(Arcadix Infotech Pvt.Ltd)
November 10, 2017, 9:45am
7
Hi.
Sorting is still not coming as expected
AbcEdf
Abc Zgdfg
if sort above, Second word is coming first because of that space
That is as far as I can see the correct and expected ASCII sorting order . I am not sure if it is possible to override this.
aneesh
(Arcadix Infotech Pvt.Ltd)
November 13, 2017, 3:34am
9
Ok. Anyway Thanks Christian_Dahlqvist.
system
(system)
Closed
December 11, 2017, 3:34am
10
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.