I'd like to have a document with localized data, but also be able to sort
on that.
Using Java over here.
Not sure why sorting on localizedInfo.DE.title is detected as field with
multiple values. It's actually very unique.
Strange thing is: sorting on float type works. But why not string?
My mapping on that field: ...startObject("localizedInfo").field("type",
"object").endObject()
Is this a bug?
I'm using 0.19.0.
Am Sonntag, 4. März 2012 03:32:50 UTC+1 schrieb Arny:
Hi,
well, I've read all the other "sort on nested" threads, but I kind of need
a solution for my issue.
I'd like to have a document with localized data, but also be able to sort
on that.
Using Java over here.
Not sure why sorting on localizedInfo.DE.title is detected as field with
multiple values. It's actually very unique.
I'd like to have a document with localized data, but also be able to
sort on that.
Using Java over here.
Not sure why sorting on localizedInfo.DE.title is detected as field
with multiple values. It's actually very unique.
I'd like to have a document with localized data, but also be able to
sort on that.
Using Java over here.
Not sure why sorting on localizedInfo.DE.title is detected as field
with multiple values. It's actually very unique.
I think that strings are analyzed by default, and therefore if you have
titles with multiple words they will be split into multiple terms, and
therefore be considered a multi-valued field. As you can imagine this is
beneficial for searching because a search for any of the terms will hit on
the title field. However, to work well with sorting, or faceting for that
matter, you need to change the mapping so that it is not analyzed {
"index":"not_analyzed"}. See Elasticsearch Platform — Find real-time answers at scale | Elastic. If
you need an analyzed field for searching and a not_analyzed field for
sorting, you will need two fields with the same data.
Mark
On Sunday, March 4, 2012 1:22:41 PM UTC-8, Arny wrote:
Thanks, I've seen that as well.
But, why is sorting:
localizedInfo.DE.someFloat
working ?
localizedInfo.DE.someString
is not working ?
Both are unique, there are no multiple values per field.
Mapping is dynamically mapped to type "string".
Whats the problem here?
Am Sonntag, 4. März 2012 09:17:13 UTC+1 schrieb Clinton Gormley:
Hiya
well, I've read all the other "sort on nested" threads, but I kind of
need a solution for my issue.
I'd like to have a document with localized data, but also be able to
sort on that.
Using Java over here.
Not sure why sorting on localizedInfo.DE.title is detected as field
with multiple values. It's actually very unique.
Thanks
On Sunday, March 4, 2012 1:22:41 PM UTC-8, Arny wrote:
Thanks, I've seen that as well.
But, why is sorting:
localizedInfo.DE.someFloat
working ?
localizedInfo.DE.someString
is not working ?
Both are unique, there are no multiple values per field.
Mapping is dynamically mapped to type "string".
Whats the problem here?
Am Sonntag, 4. März 2012 09:17:13 UTC+1 schrieb Clinton Gormley:
Hiya
well, I've read all the other "sort on nested" threads, but I kind of
need a solution for my issue.
I'd like to have a document with localized data, but also be able to
sort on that.
Using Java over here.
Not sure why sorting on localizedInfo.DE.title is detected as field
with multiple values. It's actually very unique.
On Monday, March 5, 2012 at 8:53 AM, Mark Waddle wrote:
Hi Arn,
I think that strings are analyzed by default, and therefore if you have titles with multiple words they will be split into multiple terms, and therefore be considered a multi-valued field. As you can imagine this is beneficial for searching because a search for any of the terms will hit on the title field. However, to work well with sorting, or faceting for that matter, you need to change the mapping so that it is not analyzed { "index":"not_analyzed"}. See Elasticsearch Platform — Find real-time answers at scale | Elastic. If you need an analyzed field for searching and a not_analyzed field for sorting, you will need two fields with the same data.
Mark
On Sunday, March 4, 2012 1:22:41 PM UTC-8, Arny wrote:
Thanks, I've seen that as well.
But, why is sorting:
localizedInfo.DE.someFloat
working ?
localizedInfo.DE.someString
is not working ?
Both are unique, there are no multiple values per field.
Mapping is dynamically mapped to type "string".
Whats the problem here?
Am Sonntag, 4. März 2012 09:17:13 UTC+1 schrieb Clinton Gormley:
Hiya
well, I've read all the other "sort on nested" threads, but I kind of
need a solution for my issue.
I'd like to have a document with localized data, but also be able to
sort on that.
Using Java over here.
Not sure why sorting on localizedInfo.DE.title is detected as field
with multiple values. It's actually very unique.
Thanks
On Sunday, March 4, 2012 1:22:41 PM UTC-8, Arny wrote:
Thanks, I've seen that as well.
But, why is sorting:
localizedInfo.DE.someFloat
working ?
localizedInfo.DE.someString
is not working ?
Both are unique, there are no multiple values per field.
Mapping is dynamically mapped to type "string".
Whats the problem here?
Am Sonntag, 4. März 2012 09:17:13 UTC+1 schrieb Clinton Gormley:
Hiya
well, I've read all the other "sort on nested" threads, but I kind of
need a solution for my issue.
I'd like to have a document with localized data, but also be able to
sort on that.
Using Java over here.
Not sure why sorting on localizedInfo.DE.title is detected as field
with multiple values. It's actually very unique.
Both worked and allow me to search for "city.name" "CITY" but with no
hits in results.
Also sorting doesn't works well: sort value for each hit is null and
sorting is wrong.
How to defined multi_field for nested field correctly?
Note that you don't have to have two fields with the same data to have an analyzed version and a non analyzed version. You can use the multi field mapping on the same "json field". see more here:Elasticsearch Platform — Find real-time answers at scale | Elastic....
On Monday, March 5, 2012 at 8:53 AM, Mark Waddle wrote:
Hi Arn,
I think that strings are analyzed by default, and therefore if you have titles with multiple words they will be split into multiple terms, and therefore be considered a multi-valued field. As you can imagine this is beneficial for searching because a search for any of the terms will hit on the title field. However, to work well with sorting, or faceting for that matter, you need to change the mapping so that it is not analyzed { "index":"not_analyzed"}. Seehttp://www.elasticsearch.org/guide/reference/mapping/core-types.html. If you need an analyzed field for searching and a not_analyzed field for sorting, you will need two fields with the same data.
Mark
On Sunday, March 4, 2012 1:22:41 PM UTC-8, Arny wrote:
Thanks, I've seen that as well.
But, why is sorting:
localizedInfo.DE.someFloat
working ?
localizedInfo.DE.someString
is not working ?
Both are unique, there are no multiple values per field.
Mapping is dynamically mapped to type "string".
Whats the problem here?
Am Sonntag, 4. März 2012 09:17:13 UTC+1 schrieb Clinton Gormley:
Hiya
well, I've read all the other "sort on nested" threads, but I kind of
need a solution for my issue.
I'd like to have a document with localized data, but also be able to
sort on that.
Using Java over here.
Not sure why sorting on localizedInfo.DE.title is detected as field
with multiple values. It's actually very unique.
Thanks
On Sunday, March 4, 2012 1:22:41 PM UTC-8, Arny wrote:
Thanks, I've seen that as well.
But, why is sorting:
localizedInfo.DE.someFloat
working ?
localizedInfo.DE.someString
is not working ?
Both are unique, there are no multiple values per field.
Mapping is dynamically mapped to type "string".
Whats the problem here?
Am Sonntag, 4. März 2012 09:17:13 UTC+1 schrieb Clinton Gormley:
Hiya
well, I've read all the other "sort on nested" threads, but I kind of
need a solution for my issue.
I'd like to have a document with localized data, but also be able to
sort on that.
Using Java over here.
Not sure why sorting on localizedInfo.DE.title is detected as field
with multiple values. It's actually very unique.
So I can't sort on nested fields...
Which is strange, because in my example above:
{
"name": "NAME",
"city": {
"name": "CITY",
"id": 1
}
}
It really sorts data on "city.id" - I see proper values in sort: [...]
in returned hits.
With string type I want to use multi_field "trick".
Let me know if it's possible or I'll need to rename that fields to
"top level" ones.
But how can I definemulti_fieldfornestedfield? Considering your
answer above it's possible.
Let's assume following simple structure:
{
"name": "NAME",
"city": {
"name": "CITY",
"id": 1
}}
Both worked and allow me to search for "city.name" "CITY" but with no
hits in results.
Also sorting doesn't works well: sort value for each hit is null and
sorting is wrong.
On Monday, March 5, 2012 at 8:53 AM, Mark Waddle wrote:
Hi Arn,
I think that strings are analyzed by default, and therefore if you have titles with multiple words they will be split into multiple terms, and therefore be considered a multi-valuedfield. As you can imagine this is beneficial for searching because a search for any of the terms will hit on the titlefield. However, to work well with sorting, or faceting for that matter, you need to change the mapping so that it is not analyzed { "index":"not_analyzed"}. Seehttp://www.elasticsearch.org/guide/reference/mapping/core-types.html. If you need an analyzedfieldfor searching and a not_analyzedfieldfor sorting, you will need two fields with the same data.
Mark
On Sunday, March 4, 2012 1:22:41 PM UTC-8, Arny wrote:
Thanks, I've seen that as well.
But, why is sorting:
localizedInfo.DE.someFloat
working ?
localizedInfo.DE.someString
is not working ?
Both are unique, there are no multiple values perfield.
Mapping is dynamically mapped to type "string".
Whats the problem here?
Am Sonntag, 4. März 2012 09:17:13 UTC+1 schrieb Clinton Gormley:
Hiya
well, I've read all the other "sort onnested" threads, but I kind of
need a solution for my issue.
I'd like to have a document with localized data, but also be able to
sort on that.
Using Java over here.
Not sure why sorting on localizedInfo.DE.title is detected asfield
with multiple values. It's actually very unique.
Thanks
On Sunday, March 4, 2012 1:22:41 PM UTC-8, Arny wrote:
Thanks, I've seen that as well.
But, why is sorting:
localizedInfo.DE.someFloat
working ?
localizedInfo.DE.someString
is not working ?
Both are unique, there are no multiple values perfield.
Mapping is dynamically mapped to type "string".
Whats the problem here?
Am Sonntag, 4. März 2012 09:17:13 UTC+1 schrieb Clinton Gormley:
Hiya
well, I've read all the other "sort onnested" threads, but I kind of
need a solution for my issue.
I'd like to have a document with localized data, but also be able to
sort on that.
Using Java over here.
Not sure why sorting on localizedInfo.DE.title is detected asfield
with multiple values. It's actually very unique.
In the above example, referring to field 'city.name' will actually refer
to 'city.name.name'. To sort on the untouched version, you should sort
on the field 'city.name.untouched'
In the above example, referring tofield'city.name' will actually refer
to 'city.name.name'. To sort on the untouched version, you should sort
on thefield'city.name.untouched'
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.