The postgres SearchVector in Django seems to be shortening my strings, I dont understand why. Ive shortened the code below to show what is happening.
I am querying a person object with a lastname that is added to the SearchVector.
from django.contrib.postgres.search import SearchVector
self.model.objects.annotate(
search=SearchVector(
"last_name"
)
).filter(search__icontains="hjer").first().search
reults in: "'hjerp':1"
But the last_name is actually:
self.model.objects.annotate(
search=SearchVector(
"last_name"
)
).filter(search__icontains="hjer").first().last_name
'Hjerpe'
Why is the e not present in the search string? I would expect search above to show: "'hjerpe:1'"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…