massiveart / MassiveSearchBundle

MIT License
68 stars 24 forks source link

Minor fix : elasticsearch _type #118

Closed wimvds closed 6 years ago

wimvds commented 6 years ago

When looking at the ElasticSearch indexes created with Sulu, I noticed that the _type field looked like this :

{
        "_index" : "massive_page-fr-i18n",
        "_type" : "ulu_Bundle_ContentBundle_Document_HomeDocument",
        "_id" : "cc6738ef-7fe2-4707-ba3f-0e2dac854700",
        "_score" : 1.0,
        "_source" : {
          "excerptTitle" : "",
          ...
        }
} 

As you can see, the type is missing the first letter. This PR fixes this (by stripping any preceding after converting the \ in the class names to _)...

wachterjohannes commented 6 years ago

@wimvds thanks for the contribution - but it seems to be a BC break isnt it? we should at least write it into the UPGRADE.md file

wimvds commented 6 years ago

Ow, yeah. It does require one to recreate the index (though I suspect the old entries will just be ignored). What version should I add in the UPGRADE.md (or will you add the version later on)?

wachterjohannes commented 6 years ago

@wimvds you can simply write dev-develop as the version

wachterjohannes commented 6 years ago

@wimvds thanks for adding this fix :)