Hi. I have a string field I would like to use for sorting. As of some
recent version of ES, I've started getting this IOException:
"Can't sort on string types with more than one value per doc, or more
than one token per field"
After reading some information about it, I gather that I need to mark
the field as "not analyzed". I'm using NEST, a C# library, for my ES
adapter and this is my class:
[DataContract]
[ElasticType()]
public class SearchKey
{
[DataMember]
public string Id
{
get;
set;
}
[DataMember]
public int Length
{
get;
set;
}
[DataMember]
[ElasticProperty(Index=ElasticSearch.Client.FieldIndexOption.not_analyzed,
IncludeInAll=false)]
public string SortHelper
{
get;
set;
}
...
}
Pretty simple stuff really, but it doesn't work. The same message is
being put out when I try to search. I've also tried to change the
mapping manually using the ES head plugin, with no luck either - the
field isn't being marked "not analyzed".
Hi. I have a string field I would like to use for sorting. As of some
recent version of ES, I've started getting this IOException:
"Can't sort on string types with more than one value per doc, or more
than one token per field"
After reading some information about it, I gather that I need to mark
the field as "not analyzed". I'm using NEST, a C# library, for my ES
adapter and this is my class:
[DataContract]
[ElasticType()]
public class SearchKey
{
[DataMember]
public string Id
{
get;
set;
}
[DataMember]
public int Length
{
get;
set;
}
[DataMember]
[ElasticProperty(Index=Elasticsearch.Client.FieldIndexOption.not_analyzed,
IncludeInAll=false)]
public string SortHelper
{
get;
set;
}
...
}
Pretty simple stuff really, but it doesn't work. The same message is
being put out when I try to search. I've also tried to change the
mapping manually using the ES head plugin, with no luck either - the
field isn't being marked "not analyzed".
Hi. I have a string field I would like to use for sorting. As of some
recent version of ES, I've started getting this IOException:
"Can't sort on string types with more than one value per doc, or more
than one token per field"
After reading some information about it, I gather that I need to mark
the field as "not analyzed". I'm using NEST, a C# library, for my ES
adapter and this is my class:
[DataContract]
[ElasticType()]
public class SearchKey
{
[DataMember]
public string Id
{
get;
set;
}
[DataMember]
public int Length
{
get;
set;
}
[DataMember]
[ElasticProperty(Index=Elasticsearch.Client.FieldIndexOption.not_analyzed,
IncludeInAll=false)]
public string SortHelper
{
get;
set;
}
...
}
Pretty simple stuff really, but it doesn't work. The same message is
being put out when I try to search. I've also tried to change the
mapping manually using the ES head plugin, with no luck either - the
field isn't being marked "not analyzed".
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.