Hello, I came to this site finding solutions and I found it here, so I publish here a contribution that may be of interest to others useing haystack and elasticsearch.
I have in the postgres database a json field and I suffered a lot to including it into elasticsearch trough haystack. The char field simply put it as a text in elastic search and ignores all the structure of the json.
If you simply declare the json field as a SearchField (the base class of all others) then haystack passes it as is to elastic search and elastic search beautifully creates a sub structure for the json field with all its properties !!! This was a nice discovery and solved a super problem I had.
Hello, I came to this site finding solutions and I found it here, so I publish here a contribution that may be of interest to others useing haystack and elasticsearch.
I have in the postgres database a json field and I suffered a lot to including it into elasticsearch trough haystack. The char field simply put it as a text in elastic search and ignores all the structure of the json.
If you simply declare the json field as a SearchField (the base class of all others) then haystack passes it as is to elastic search and elastic search beautifully creates a sub structure for the json field with all its properties !!! This was a nice discovery and solved a super problem I had.
Hope this be also useful for others. Cheers, Jose