"ccc"
but in Elastic search when I use this query
{
"fields": [
"title"
],
"query": {
"query_string": {
"query": "*",
"fields": [
"title"
]
}
},
"sort": [
{
"title.untouched": "asc" // title is multi_field
}
]
}
The result allways
"AAA"
"BBB"
"CCC"
"aaa"
"bbb"
"ccc"
It's not correct. Help me please.
I use the analysis
"settings":{
"index" : {
"analysis" : {
"analyzer" : {
"index_analyzer" : {
"tokenizer" : "keyword",
"filter" : ["icu_collation"]
}
}
}
}
}
"ccc"
but in Elastic search when I use this query
{
"fields": [
"title"
],
"query": {
"query_string": {
"query": "*",
"fields": [
"title"
]
}
},
"sort": [
{
"title.untouched": "asc" // title is multi_field
}
]
}
The result allways
"AAA"
"BBB"
"CCC"
"aaa"
"bbb"
"ccc"
It's not correct. Help me please.
I use the analysis
"settings":{
"index" : {
"analysis" : {
"analyzer" : {
"index_analyzer" : {
"tokenizer" : "keyword",
"filter" : ["icu_collation"]
}
}
}
}
}
"ccc"
but in Elastic search when I use this query
{
"fields": [
"title"
],
"query": {
"query_string": {
"query": "*",
"fields": [
"title"
]
}
},
"sort": [
{
"title.untouched": "asc" // title is multi_field
}
]
}
The result allways
"AAA"
"BBB"
"CCC"
"aaa"
"bbb"
"ccc"
It's not correct. Help me please.
I use the analysis
"settings":{
"index" : {
"analysis" : {
"analyzer" : {
"index_analyzer" : {
"tokenizer" : "keyword",
"filter" : ["icu_collation"]
}
}
}
}
}
Perhaps I was premature in suggesting scripts given that I have never
used them for sorting. I assumed they worked like facet scripts, where
they return the value to be used, but it appears that sorting scripts
return a numerical value to be sorted on.
I wonder would it be possible to have script like:
"sort": {
"_script": {
"script": "doc['title'].value.toLowerCase",
"type": "string",
}
}
"ccc"
but in Elastic search when I use this query
{
"fields": [
"title"
],
"query": {
"query_string": {
"query": "*",
"fields": [
"title"
]
}
},
"sort": [
{
"title.untouched": "asc" // title is multi_field
}
]
}
The result allways
"AAA"
"BBB"
"CCC"
"aaa"
"bbb"
"ccc"
It's not correct. Help me please.
I use the analysis
"settings":{
"index" : {
"analysis" : {
"analyzer" : {
"index_analyzer" : {
"tokenizer" : "keyword",
"filter" : ["icu_collation"]
}
}
}
}
}
Another option is to have the title indexed as multi field, once with a
keyword tokenizer and lowercase, and once just with keyword tokenizer (so
it retains the casing). Sorting can be done on the lowercase one, and
fetching the relevant actual non lowercased field can be done by simply
asking for it from results.
On Fri, Mar 16, 2012 at 7:29 PM, Ivan Brusic ivan@brusic.com wrote:
Perhaps I was premature in suggesting scripts given that I have never
used them for sorting. I assumed they worked like facet scripts, where
they return the value to be used, but it appears that sorting scripts
return a numerical value to be sorted on.
I wonder would it be possible to have script like:
"sort": {
"_script": {
"script": "doc['title'].value.toLowerCase",
"type": "string",
}
}
"ccc"
but in Elastic search when I use this query
{
"fields": [
"title"
],
"query": {
"query_string": {
"query": "*",
"fields": [
"title"
]
}
},
"sort": [
{
"title.untouched": "asc" // title is multi_field
}
]
}
The result allways
"AAA"
"BBB"
"CCC"
"aaa"
"bbb"
"ccc"
It's not correct. Help me please.
I use the analysis
"settings":{
"index" : {
"analysis" : {
"analyzer" : {
"index_analyzer" : {
"tokenizer" : "keyword",
"filter" : ["icu_collation"]
}
}
}
}
}
I set multi field "title" for index_analyser and "title.untouched" for
"sort_analyzer" but this setting don't run like I want. It sorts by
aaa
AAA
bbb
BBB
( i don't want this).
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.