1
목록의 길이로 검색을 정렬하려고합니다. 나는 필드가 지금처럼 보일 수 있습니다이 필드를 기준으로 정렬 할Elasticsearch 목록의 길이를 기준으로 정렬하는 방법
"authors": {
"type": "text", "norms": { "enabled": False }, "analyzer": "autocomplete_with_asciifolding", "search_analyzer": "with_and_without_accent_search", "position_increment_gap": 100,
"fields": {
"raw" : { # This field is needed for your_paper suggestions search
"type" : "string",
"analyzer" : 'lower_keyword'
}
}
}
에 의해 정의 [ '홍길동', '마이크 스미스']를 elasticsearch 문서에 따라
및 일부 Google I를 검색
doc['sort'] = {
"_script": {
"type": "number",
"script": "doc['authors'].length",
"order": "asc"
}
}
나는 또한 시도 의사 [ '저자']. values.length() 및 문서 [ '저자']. values.size()을 찾았지만, 그들 모두는
TransportError: TransportError(500, u'search_phase_execution_exception')
0 발생
목록 길이별로 정렬하는 방법을 알고 싶습니까?