Skip to content

tej172/SC4021-Information-Retrieval

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

100 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SC4021 Info Ret.

Youtube guide for solr set up: Link (Updated)

Apache Solr Setup & Usage

This guide walks you through downloading, installing, and running Apache Solr. It also covers setting up your Java environment (JAVA_HOME) and provides a quick comparison between Solr and a traditional relational database.


1. Prerequisites

1.1 Check Java Installation

On Windows (Command Prompt)

  1. Open Command Prompt:
    Press Windows + R, type cmd, and press Enter.

  2. Check Java Version

    java -version

    Example Output:

    java version "17.0.2" 2022-01-18 LTS
    Java(TM) SE Runtime Environment (build 17.0.2+8-LTS-86)
    Java HotSpot(TM) 64-Bit Server VM (build 17.0.2+8-LTS-86, mixed mode, sharing)
    

On Git Bash or Unix-like Terminal

java -version

Example Output:

openjdk version "17.0.2" 2022-01-18
OpenJDK Runtime Environment (build 17.0.2+8)
OpenJDK 64-Bit Server VM (build 17.0.2+8, mixed mode)

1.2 Set JAVA_HOME (Windows) (if using windows cmd)

Find Java Path

where java

Example Output:

C:\Program Files\Eclipse Adoptium\jdk-21.0.6.7-hotspot\bin\java.exe
  • Copy everything before \bin\java.exe, for example:
C:\Program Files\Eclipse Adoptium\jdk-21.0.6.7-hotspot

Set JAVA_HOME Temporarily

set JAVA_HOME=C:\Program Files\Eclipse Adoptium\jdk-21.0.6.7-hotspot

Set JAVA_HOME Permanently

setx JAVA_HOME "C:\Program Files\Eclipse Adoptium\jdk-21.0.6.7-hotspot" /M

Verify:

echo %JAVA_HOME%

Example Output:

C:\Program Files\Eclipse Adoptium\jdk-21.0.6.7-hotspot

1.3 Set JAVA_HOME in Git Bash (if using git)

Temporary Session

export JAVA_HOME="/c/Program Files/Eclipse Adoptium/jdk-21.0.6.7-hotspot"

Permanently in ~/.bashrc

nano ~/.bashrc

Add this line:

export JAVA_HOME="/c/Program Files/Eclipse Adoptium/jdk-21.0.6.7-hotspot"

Load new settings:

source ~/.bashrc

Windows

Option A: Temporary (Current Session Only)
set JAVA_HOME=C:\Program Files\Eclipse Adoptium\jdk-11.0.18.10-hotspot
Option B: Permanent (Requires Admin for System-Wide)
  • For current user (no admin needed):
    setx JAVA_HOME "C:\Program Files\Eclipse Adoptium\jdk-11.0.18.10-hotspot"
  • For all users (admin required):
    setx JAVA_HOME "C:\Program Files\Eclipse Adoptium\jdk-11.0.18.10-hotspot" /M
    (Remove quotes if they cause issues.)

2. Download and Unpack Solr

  1. Download Apache Solr

  2. Extract Solr into the Repo Folder

    • Move the downloaded solr-9.8.1.zip into your repo folder (e.g., SC4021-Information-Retrieval-main/).
    • Extract it there, resulting in:
      SC4021-Information-Retrieval-main/
      ├── solr-9.8.1/  
      ├── other_repo_files/  
      ├── searchEngine/  
      └── ...
      

3: Application Start Up

  1. Run the start.py file in the Repo:
  2. cmd print out:
    JAVA_HOME is set to: ...\Programs\Eclipse Adoptium\jdk-21.0.6.7-hotspot
    Starting Solr in the background...
    Solr started with PID: 21132
    To access Solr: http://localhost:8983/solr/
  3. Open http://localhost:8983/solr/ in a browser to confirm it’s running.
  4. If no data upon startup, run the importJson.py file in the Repo:
  5. cmd print out:
    JSON data imported successfully!
    Changes committed successfully!
  6. If error of no core: run the create_core() function in the start.py then proceed to Step 4 to import the data to the core

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors