What I wanted to achieve is, if user enters search for "laptp" then database should return results with actual word "Laptop". Similarly if user enters "ambroidery", then database should return results with both "embroidery" and "embroidred" words containing strings. Hope it clears!!
So what I tried is, I went through whole django documentation and closest thing I found is "Trigram Similarity" search. I followed documentation and tried this:
data = 'silk'
data= Product.objects.annotate(
similarity=TrigramSimilarity('description', data)).filter(similarity__gt=0.3).order_by('-similarity')
In my database, I have Products
whose description contains word "silky" but every time I runs this query I get empty query set. Even when I put data value "silky", again I got empty query set.
So first of all suggest me that whether this is right approach for what I wanted to achieve and secondly if it is, then why it is returning empty query set?