Basically, I have an analyzed string field and a non-analyzed version of it
so that I can sort by it. But instead of sorting by "field.sort" or
"field.raw", I need to use "field_sort", basically for back compat reasons.
To accomplish that I tried giving the non-analyzed sortable version of the
string field an index_name. But trying to sort using the given index_name
results in an error: "No mapping found for [field_sort] in order to sort
on".
The gist referenced above is slightly different than I am explaining,
because it puts the "index_name" on the parent field instead of the sorted
part, but the result is the same.
To put it simply, it seems that you cannot sort by a field by its
index_name, you have to use the full path to it, which is a problem for me.
Is this expected? Why should I be able to search for a field by its
index_name but not sort by it -- that seems unintended. Am I doing it
wrong? Is there a better way to accomplish the same thing?
Basically, I have an analyzed string field and a non-analyzed version of it so that I can sort by it. But instead of sorting by "field.sort" or "field.raw", I need to use "field_sort", basically for back compat reasons. To accomplish that I tried giving the non-analyzed sortable version of the string field an index_name. But trying to sort using the given index_name results in an error: "No mapping found for [field_sort] in order to sort on".
The gist referenced above is slightly different than I am explaining, because it puts the "index_name" on the parent field instead of the sorted part, but the result is the same.
To put it simply, it seems that you cannot sort by a field by its index_name, you have to use the full path to it, which is a problem for me. Is this expected? Why should I be able to search for a field by its index_name but not sort by it -- that seems unintended. Am I doing it wrong? Is there a better way to accomplish the same thing?
Basically, I have an analyzed string field and a non-analyzed version of
it so that I can sort by it. But instead of sorting by "field.sort" or
"field.raw", I need to use "field_sort", basically for back compat reasons.
To accomplish that I tried giving the non-analyzed sortable version of the
string field an index_name. But trying to sort using the given index_name
results in an error: "No mapping found for [field_sort] in order to sort
on".
The gist referenced above is slightly different than I am explaining,
because it puts the "index_name" on the parent field instead of the sorted
part, but the result is the same.
To put it simply, it seems that you cannot sort by a field by its
index_name, you have to use the full path to it, which is a problem for me.
Is this expected? Why should I be able to search for a field by its
index_name but not sort by it -- that seems unintended. Am I doing it
wrong? Is there a better way to accomplish the same thing?
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.