#30446: SerachVectorField cannot be updated pure string
-------------------------------------+-------------------------------------
Reporter: Ozan | Owner: nobody
Gerdaneri |
Type: Bug | Status: new
Component: Database | Version: 2.2
layer (models, ORM) | Keywords: SearchVector,
Severity: Normal | SearchVectorField , Value
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Hi,
I have a model of AModel. AModel has a SearchVectorField named
search_vector. I want to update this vector by indexing a string that is
not in any other field.
{{{
from django.db.models import Value
from django.contrib.postgres.search import SearchVector
AModel.objects.filter(pk=1).update(search_vector=SearchVector(Value("a
string to be indexed and inserted to search_vector field")))
}}}
This code generates this error:
{{{
FieldError: Cannot resolve expression type, unknown output_field
}}}
It seemed to be a bug since I found similar usages in forums..
--
Ticket URL: <https://code.djangoproject.com/ticket/30446>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/048.c6731cf7d30cdd93a742fdfb7d3a7add%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.