Minds / engine

mirror of https://gitlab.com/minds/engine
https://minds.com
GNU Affero General Public License v3.0
200 stars 93 forks source link

ElasticsearchException[Field [suggest] is not a completion suggest field #16

Closed malensok closed 1 year ago

malensok commented 6 years ago

I have problems with search suggest that ElasticsearchException[Field [suggest] is not a completion suggest field

and cannot suggest search now.

Thanks alot

markharding commented 6 years ago

Are you running elasticsearch 5+?

nguyenpc commented 6 years ago

@markharding I have the same problem, below is what I got when running with ElasticSearch 5.6.8:

{"status":"error","message":""index" is not a valid parameter. Allowed parameters are: "analyzer", "analyze_wildcard", "default_operator", "df", "explain", "from", "ignore_unavailable", "allow_no_indices", "expand_wildcards", "indices_boost", "lenient", "lowercase_expanded_terms", "preference", "q", "query_cache", "request_cache", "routing", "scroll", "search_type", "size", "sort", "source", "_source", "_source_exclude", "_source_include", "stats", "suggest_field", "suggest_mode", "suggest_size", "suggest_text", "timeout", "version", "fielddata_fields", "docvalue_fields", "filter_path", "client", "custom", "filter_path""}

gem2578 commented 6 years ago

I have the same problem, I am trying to start a dev minds with vagrant. Looking at the _query structure index is NULL

["_query":protected]=> array(3) {
    ["size"]=> string(1) "3"
    ["index"]=> NULL
    ["body"]=> array(1) {
        ["query"]=> array(1) {
            ["query_string"]=> array(4) {
                ["query"]=> string(18) "minds +public:true"
                ["default_operator"]=> string(3) "AND"
                ["minimum_should_match"]=> string(3) "75%"
                ["fields"]=> array(5) {
                    [0]=> string(4) "_all"
                    [1]=> string(6) "name^6"
                    [2]=> string(7) "title^8"
                    [3]=> string(10) "username^8"
                    [4]=> string(7) "tags^12"
                }
            }
        }
    }
}
gem2578 commented 6 years ago

You can get the full stack trace by calling the API from postmen

gem2578 commented 6 years ago

@markharding The problem is ["index"]=> NULL

The version you are using checks if the key value isset but null is a not set value. However in the newer version it uses array_key_exists

so updating the elasticsearch-php version may fix the problem https://github.com/elastic/elasticsearch-php/issues/559