0

I want to do search from android app using api build in django rest framework. Like haystack elasticsearch we can make search in html using django. Can any one tell how to use drf with elasticsearch ?

1 Answer 1

1

You should show us what you got so far

I would:

  • pick one of the implementations of elasticsearch for django out there
  • create a DRF-serializer class for a single search result/or the specific model class (with the fields that you need on the frontend)
  • create a view that checks for a GET-parameter e.g. ?query=foo and use that to engage your search
  • then serialize the results and return it
Sign up to request clarification or add additional context in comments.

4 Comments

I could not understand what exactly you want me to do. Can you pls explain me with some code example. And i have written my approach can you please see it and suggest me any change.
So your main concern is performance? I would time the different parts of the request to find out where most time is used. Search for python/django profiling to get started. And I would repeat the experiment on a machine with more ram/cpu available for better measurement. I would have suspected the search server to take the motherload of time... but since you say it's very fast.
Thanks for your help . And I haven't measured the server response time but I saw the average response time of elastic search from heroku add on console. where it was under 58 ms.
I have added django profiling please see it : gist

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.