Rob_Aldred
(Rob Aldred)
December 5, 2012, 4:57pm
1
Hi All.
I have a multi_field index for document titles,
one is analyzed the other is not.
"title":{
"type":"multi_field",
"fields":{
"title":{
"type":"string",
"analyzer":"snowball",
"boost":100
},
"title_std":{
"type":"string",
"index":"not_analyzed"
}
}
}
When I sort by "title_std" it's sorting case aswell
So for example results are coming out as:
0 => Apple
1 => Orange
2 => Strawberry
3 => Watermelon
4 => banana
5 => mango
6 => nectarine
Any idea how I fix this... I need sorting regardless of case:
0 => Apple
1 => banana
2 => mango
3 => nectarine
4 => Orange
5 => Strawberry
6 => Watermelon
Thanks in advance for your help.
--
Rob_Aldred
(Rob Aldred)
December 5, 2012, 5:17pm
2
On Wednesday, 5 December 2012 16:57:34 UTC, Rob Aldred wrote:
Hi All.
I have a multi_field index for document titles,
one is analyzed the other is not.
"title":{
"type":"multi_field",
"fields":{
"title":{
"type":"string",
"analyzer":"snowball",
"boost":100
},
"title_std":{
"type":"string",
"index":"not_analyzed"
}
}
}
When I sort by "title_std" it's sorting case aswell
So for example results are coming out as:
0 => Apple
1 => Orange
2 => Strawberry
3 => Watermelon
4 => banana
5 => mango
6 => nectarine
Any idea how I fix this... I need sorting regardless of case:
0 => Apple
1 => banana
2 => mango
3 => nectarine
4 => Orange
5 => Strawberry
6 => Watermelon
Thanks in advance for your help.
It's Ok, I managed to find some more information posted in another thread
about filtering the field as lowercase with a custom analyzer
analysis: {
analyzer: {
sortable: {
tokenizer: "keyword",
filter: ["lowercase"]
}
}
}
My mapping is now as follows:
"title":{
"type":"multi_field",
"fields":{
"title":{
"type":"string",
"analyzer":"snowball",
"boost":100
},
"title_std":{
"type":"string",
"analyzer":"sortable"
}
}
}
Thanks
Rob
--