Elasticquent icon indicating copy to clipboard operation
Elasticquent copied to clipboard

Mapping fields in ElasticSearch 7.*

Open singhgursharnbir opened this issue 4 years ago • 5 comments

How do I map field in latest version of Elastic search as type is removed and when I try to use put mapping it gives me error

"illegal_argument_exception","reason":"Types cannot be provided in put mapping requests, unless the include_type_name parameter is set to true"

singhgursharnbir avatar Jun 02 '20 19:06 singhgursharnbir

I have the same issue, do you have any updates?

hrodriguez758 avatar Jun 05 '20 15:06 hrodriguez758

I think there is no solution to this in this package, it doesnt support new versions of Elastic Search really well.. look into elastic search's own package I think its called Elastic_php something.. I am putting elastic search on back burner for now

singhgursharnbir avatar Jun 05 '20 15:06 singhgursharnbir

I found the solution just add this code in your model

    /**
     * Gets the type name to be used in elastic search.
     */
    function getTypeName()
    {
        return '';
    }

by default, this package gets the name types and in our case, we don't need the type name

hrodriguez758 avatar Jun 05 '20 15:06 hrodriguez758

Nice that work for me !

devglrd avatar Jul 22 '20 14:07 devglrd

Hello,

Is there a solution to this problem?

piep14 avatar Feb 09 '22 01:02 piep14