This post follows up the first one Flask and Apache Solr 7.5. Now we are going to several user inputs for returning values in from Solr.

The code is at github:

A quick follow up on what we have:

Flask is and Solr is running on localhost. The template Search.html has a input field and 4 radio buttons. The user enters a string of any kind and select’s in what field to search Solr. The fields for now is according to the schema we built, id, tag, plant and description.

When the user enters a input it goes first to the view, the to the data access object (both .py) and returns the result as a Json list in Search.html and max rows from Solr is default here to 10000.

Lets search for id 512, id 2512, desc Smoke and some more.

Id 512, return all rows where id contains 512:

Id 2512 returns just the row where id 2512 is:

Description contains smoke:

And there you have it