-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to index postgres' JSONField? #1389
Comments
That's a relatively new feature which we have no special support for yet. If you were just using, say, tags or other simple field values you could simply have a multivalued field to put the data in but Haystack tends not to have support for things which aren't portable across search backends like ElasticSearch's nested objects. You'll definitely need a custom Something like this should work for getting the data into either ElasticSearch or a Solr dynamic field:
(For something like your Haystack doesn't attempt to validate field names in queries so you should be able to filter as long as you know the key value. What I think will be tricky – and probably best solved by getting the ES connection object (e.g. with Solr that's |
Hi, is there any update about JSONField indexes? Is there any new good approach to accomplish that? |
@kristoff-it @cacarrara Speaking for providing support for ElasticSearch, it can not happen as ES doesn't support dynamic mapping between documents. In case of django you can dynamically modify JSON between multiple records but mapping for ES needs to be consistent between documents(records). but ES supports Nested Field Datatypes which could be useful for dynamically increase same type type of field. |
Hi, I'm not sure if this is something I failed to find/understand from the docs or if it is an entirely new feature.
Basically I have a project in which models have a 'custom property' system powered by Postgres' JSONField. This allows users to add a json document to the set of properties of each object.
I'd like to be able to search (via ES) those fields like they were any other property.
As an example:
What type of SearchField should I use?
Thanks!
The text was updated successfully, but these errors were encountered: