나는 Play와 ElasticSearch의 초보자이며 POC 용으로 구성하려고 시도해 왔습니다. 나는 내가 ((1.2.4 플레이)를 CRUD 모듈을 사용하고 재생 프레임 워크를 사용한 elasticsearch와 관련된 문제
@ElasticSearchable
@Entity
public class Book extends Model{
@Required
public String title ;
@Required
public String author ;
@Required
public String publisher ;
public String binding ;
@Required
public double price ;
public double discount ;
@Required
@MaxLength(4)
public String releasedYear ;
@Required
public boolean inStock ;
public String language ;
public String deliveryTime ;
}
예약
라는 모델을 만들었습니다 그리고 메모리 데이터베이스 H2에 몇 가지 기록을 만들었으며 그 기록은 elasticsearch 노드에 색인을) 나는 ES 관리 인터페이스를 사용하여 검색을 수행 할 때 우리가 플레이의 ES 모듈을 사용할 때 (기본적으로 제공) ES를 실행하는 내 로컬 컴퓨터를 사용하여, 나는 이상한 문제
I에 명중했다 제목이 "Java for beginners"인 책이 하나 있는데 ES-Admin Interface에서 필드 제목에 대한 용어 쿼리를 실행하려고합니다.
{"query" : {"term" : { "title" : "Java for beginners" }}}
그리고 그것은 나에게 기본적으로 거기에 내가
{"query" : {"term" : { "title" : "beginners" }}}
내 쿼리를 변경할 때
이상하게 일치하는 레코드가 없습니다 그것은 나에게 레코드를 반환하는 것을 의미한다
{
took: 3
timed_out: false
_shards: {
total: 5
successful: 5
failed: 0
}
hits: {
total: 0
max_score: null
hits: [ ]
}
}
반환 다음과 같이
누군가가이에 대한 몇 가지 빛을 던질 수있는 경우{
took: 3
timed_out: false
_shards: {
total: 5
successful: 5
failed: 0
}
hits: {
total: 1
max_score: 0.19178301
hits: [
{
_index: models_book
_type: models_book
_id: 1
_score: 0.19178301
_source: {
title: Java for beginners
author: Bruce Eckel
publisher: Timburys
binding: Paperback
price: 450
discount: 10
releasedYear: 2010
inStock: true
language: English
deliveryTime: 3 days
id: 1
}
}
]
}
}
그것은 큰 도움이 될 것입니다. 올바른 방향으로 어떤 도움을 크게
감사
감사합니다, 그 일을! – Rocky