1
모델 :Elasticsearch 매핑은 레일 키 - 값 저장소에서 속성을 포함하지 않는
class Item
store :socket_store, accessors: [:sockets, :socket_count, :socket_link_count]
end
매핑 :
mapping do
indexes :id, key: "value", index: :not_analyzed
indexes :sockets, type: "object"
indexes :socket_count, type: "integer"
indexes :socket_link_count, type: "integer"
end
그러나 여기가 내 실제 지수는 모습입니다 같은 :
socket_cout
과 2 개의 속성은 다음의 루트에 없습니다. 마치 완전히 무시 된 것처럼 매핑.
다른 이름으로 메소드를 작성하여 to_indexed_json에 추가 할 수 있다는 것을 알고 있지만, 그것이 작동해야한다고 추측했을 것입니다.
이름 불일치가 있습니까? 그것이 영향을 미치는지 모른다. 'linked_socket_count'! = socket_link_count' – aledalgrande
아, 죄송합니다, 저는 방금 필드 이름을 바꾸었지만 그 당시에는 정확했습니다. 문제가 해결되었습니다. – Robin
@ karmi 어떤 아이디어? :디 – Robin