- First download and unzip Solr which can be done from https://lucene.apache.org/solr/downloads.html
- Inorder to run Solr, you will also need to have java installed with the JAVA_HOME system variable set to the java location
- download Java and install
- from the control panel > System and Security > System
- you should see Advanded system settings > Advanced tab > Environment Variable
- here Edit or add a system variable for JAVA_HOME to where your java installation is
- Start solr from the command line (or powershell) by going to the solr install folder location and typing bin\solr -start
- note if this doesn't work you may have to use the bin\solr.cmd -start
- Solr should start up and be runing on port 8983
- Create a collection in solr with bin\solr create -c book -s 2 rf 2
- note that book is the collection name, and can be replaced with whatever name you desire.
- There should now be a new folder created in server\solr\books (or whatever you collection name was)
- Copy the managed_schema file from the Resources\solr in the repository to server\solr\books\conf and overwrite the existing file
- stop solr with bin\solr stop -all, and then restart with bin\solr start
- this is so solr can read the new schema
- verify by going to http://localhost:8983/solr/#/books/schema, and in the fields there should be records like author, average rating, etc..
This application uses a sql server backend so sql server is needed to run this project
- If you do not have sql server, download and install a version of sql server express from microsoft.
- Also install Sql Server Studio manager in order to manage the database server.
- if you are going to using sql auth on a new installation, then you may have to change your sql server settings to allow for windows auth and sql auth in SSMS by right clicking on the server > properties > security > and selecting SQL server and windows authentication mode
- you also may need to setup a user to be able to access the database with, this user should be able to create and update a database.
In order to run or deploy the code you will need and ide. Visual Studio is recommend and the Community version is free
- make sure the .netcore2.2 is installed
- In the BookListing.Website project updating the appsetting.json
- Update the DefaultDatabase: so that the connection string can access the database that was created
- update the solrUrl and collection to match the url that solr is running on and the collection that was created
- from the Package manager Console make sure that the default project is now set to BookListing.DataAccess
- Type in >update-database
- this should create the new database and setup all the database tables needed for your application.
- run the application for the first time
- this may take a few minutes as it will also seed the database and index that data in solr with some initial sample data which can be found at BookListing.DataAccess\SampleData\books.csv
- It will also create 2 users with u:pw { admin:admin } and {user: user}
There are various ways this project can be deployed, however, doing so from Visual studio may be the easiest way to do so. Right click on the main BookListing.Website > Choose Publish >
- this will include various options include publishing to an azure app service, through FTP/IIS, or to a folder
- You many want to choose a specfic option depending on you setup or if you have an azure account.
- For this porject if you choose Folder > the project will build in RELEASE mode, to which the resulting package could also then be deployed to a system of your choosing.
- When deploying a Solr instance should be setup (with the collection created and the schema copied over from the Resources/solr folder) and available to the webserver that is hosing the actual website.
- The Database server/location should also be availbe to the webserver
- in the appsetting.json file, the location for solr and the database connection string should be set accordingly.