aSoulja
aSoulja

Reputation: 41

How to create a search functionality that searches for ingredients when the user searches for a meal?

I am trying to create a project in Django which allows users to see a list of images of the ingredients when they search for a particular meal, but I am not sure how I would start this project.

I can see that there are some apis available, however, I intend to create this from scratch.

For example, if the user enters lasagne the images displayed will be the ingredients of lasagne so the pastry, minced meat etc.

Upvotes: 0

Views: 44

Answers (1)

Vipin Gupta
Vipin Gupta

Reputation: 890

You can use a search engine such as Elasticsearch which will index your data and give you an optimized search solution.

If you don't intend on using a search engine, you can have a look at Field lookups (such as exact, contains, etc)in django which help you find model objects on the basis of the text you type in

Link of django docs:

https://docs.djangoproject.com/en/2.1/ref/models/querysets/#field-lookups

Upvotes: 2

Related Questions