2
我試圖從Elasticsearch-rails gem中獲取亮點,但是我無法使其工作。Elasticsearch-rails,亮點查詢
我的搜索方法:
當我映射我在查看結果,以檢查是否有任何亮點,我得到的false
數組:
= @results.map(&:highlight?)
我通過Elasticsearch閱讀docs here:https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-highlighting.html和寶石的文檔在這裏:https://github.com/elastic/elasticsearch-rails/tree/master/elasticsearch-model和我的查詢似乎是正確的。不知道如何繼續。
'_all'在elasticsearch代表實際現場'_all'包含所有的字段組合。所以如果你有'name'和'descrption',所有的都會包含'name' +'description' ...這對調試很有用 – equivalent8