5
필자는 모든 결과가 일련의 정보 뒤에 착용되어야한다는 의미에서 "스마트"자동 완성을 구축해야합니까?자동 완성 "smart"
예를 들어: 나는 "볼로냐"을 찾고
를 내가 쿼리 실행해야 "볼로냐는"어디 (또는 하나 이상의, 나는 가능한 한 작은 만들 수있는 방법을 찾고 있었다) "이름", "지역"및 "지역"필드에서 검색합니다.
"볼로냐"에 얼마나 많은 구조가 있는지 세는 것이 필요하다.
이
는 데이터베이스 스키마입니다 :index:
analysis:
analyzer:
custom_search_analyzer:
type: custom
tokenizer: standard
filter : [standard, snowball, lowercase, asciifolding]
custom_index_analyzer:
type: custom
tokenizer: standard
filter : [standard, snowball, lowercase, asciifolding, custom_filter]
filter:
custom_filter:
type: edgeNGram
side: front
min_gram: 1
max_gram: 20
{
"structure": {
"properties": {
"name": {"type": "string", "search_analyzer": "custom_search_analyzer", "index_analyzer": "custom_index_analyzer"},
"locality": {"type": "string", "search_analyzer": "custom_search_analyzer", "index_analyzer": "custom_index_analyzer"},
"province": {"type": "string", "search_analyzer": "custom_search_analyzer", "index_analyzer": "custom_index_analyzer"},
"region": {"type": "string", "search_analyzer": "custom_search_analyzer", "index_analyzer": "custom_index_analyzer"}
}
}
}
은 분명히 내가 루프와 PHP로 예를 들어, 서버 측에서이 작업을 수행 할 수 있지만, 대답은 매우 느린 것 및 elasticsearch의 모든 속도를 좌절되었다 .
이 시점에서 나는 어떻게이 일을 할 수 있었는지 궁금합니다.
완성 된 수호자를 보셨습니까? http://www.elasticsearch.org/blog/you-complete-me/ – javanna
예, 나는 elasticsearch에 제안을 보았습니다. 그러나 질문에서 언급했듯이 검색에서 간단한 자동 완성보다 많은 데이터가 필요합니다. 탄력적 인 탐색을 제안하는이 일은 불가능합니다. 적어도 나는 그 방법을 모른다. – Lughino
당신이 무엇을 요구하고 있는지 완전히 이해하지 못했습니다. 완료시'페이로드 '가 문제를 해결합니까? http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-suggesters-completion.html – Sangharsh