0

I am attempting to integrate Elasticsearch as a search engine for my static website. I use the Python package "Lektor" as my static website generator. I have been able to automate indexing all my webpages into Elasticsearch. Additionally, I am using Bootstrap to have a navigation bar on the top of the website. I have added the relevant search bar code from Bootstrap and it looks exactly like I want it to. My issue is with connecting the Bootstrap search bar to my Python code that queries the Elasticsearch cluster I have set up. I am hoping to process the search bar data and send it as an argument to my Python querying function. Is this possible? I know how to do this with Flask and setting up an endpoint, but in this case, I do not know how to set a specific endpoint for search that reacts to the search bar's form data.

  • Certainly possbile. `my Python code that queries the Elasticsearch cluster`: Can you show the usage of this, and the sample response? Also a demonstration of anything you have already tried to put this together will help you get an answer :) – v25 Aug 04 '20 at 22:34
  • Hi, Thanks for responding! The Bootstrap component looks like: `````` – Yash Bhalla Aug 05 '20 at 01:30
  • The framework uses Jinja2 templating and so the function is available to be called directly in the HTML, I just do not know how to obtain the form data. I know usually it sends a POST to a specific endpoint that then handles the form data, but I was wondering if there was another way to access the data. – Yash Bhalla Aug 05 '20 at 02:42
  • https://stackoverflow.com/questions/10434599/get-the-data-received-in-a-flask-request – v25 Aug 05 '20 at 08:14

0 Answers0