This project is a web application that allows users to search for company information. It integrates MongoDB and Elasticsearch to provide efficient search and suggestion capabilities. Users can type in the search box to get suggestions and view detailed information about companies.
Clone the Repository
git clone https://github.com/sachnaror/company-search.git
cd company-search
Install Dependencies
Install the required Python packages:
pip install -r requirements.txt
Install Elasticsearch and MongoDB:
Follow the official installation guides:
Set Up the Database
Import the company data into MongoDB:
mongoimport --db companyDB --collection companies --file /path/to/CompanyExtracted.json --jsonArray
Run Elasticsearch
Ensure Elasticsearch is running on http://localhost:9200
.
Run Migrations
Apply Django migrations:
python manage.py migrate
Start the Django Development Server
python manage.py runserver
Visit http://localhost:8000
in your web browser.
views.py
: Contains the view functions for handling search and suggestions.index.html
: The main page where users can input search queries and view search results.search_results.html
: Displays the results of the search query.company_detail.html
: Shows detailed information about a specific company.index(request)
: Renders the main search page.search(request)
: Handles search requests and displays results.company_detail(request, registration_number)
: Displays detailed information for a specific company.search_suggestions(request)
: Provides real-time search suggestions based on user input.company_index
urls.py
are correctly configured and that the search_suggestions
view is properly implemented.CompanyExtracted.json
file is correctly formatted and matches the expected schema.For any questions or issues, please contact Sachin.