Search code examples
mysqldjangofull-text-searchdjango-haystackwhoosh

Looking solutions for performing full text search with low memory cost


I wrote a web application using Django to display products information.

My database (MySQL) contains ~200000 records ( fields: brand, name, and img). I want to add a search function to my app (the search is performed on brand and name fields).

I tried haystack with Whoosh, but I found it cost a lot of memory.

Can anyone suggest a way to do it? The application is expected running on a cheap AWS EC2 (small memory).


Solution

  • Memory vs speed is ultimately a trade-off. I would recommend Elasticsearch but the baseline memory requirement for that would be atleast 256 MB (mainly for the JVM). You can perhaps try using Typesense which has a much lower baseline memory footprint (probably less than 10 MB).

    However, remember that speed vs memory is always a trade-off.