Git Product home page Git Product logo

assignment2's Introduction

The Anatomy of a Search Engine

The repository contains a gradle applications project template for completing Assignment number 2.

Project Structure

src
└── main
│    ├── java
          ├── com.example.searchengine
│    │              ├── Crawler.java # Abstract class for all crawlers
│    │              └── IndexFlipper.java # map object class
│    │              └── MultithreadCrawler.java #Instantiation of a multithreaded crawler
│    │              └── SearchEngine.java #Implementation of a search engine
                    └── SearchEngineApplication.java #Main Spring class, this class should need to be modified.
                    └── SearchEngineProperties.java #Spring class to define the properties, this class should not need to be modified.
│    │              └── SimpleCrawler.java #Instantiation of a simple crawler (with only one thread)
│    ├──  resources
          ├── static
                └── index.html  # The main page of the search engine (TO COMPLETE)
│         └── index.csv  # CSV file to store the index generated by the crawler.
│         └── index_flipped.csv  # CSV file to store the flipped index generated by the index flipper.
│         └── search_engine_api.yaml  # OpenAPI description of the Search Engine (TO COMPLETE)
└── test
      ├── TestBase.java
      └── CrawlerTest.java
      └── SimpleCrawlerTest.java
      └── MultithreadCrawlerTest.java
      └── IndexFlipperTest.java
      └── SearcherTest.java

Setup Linux or MacOS

The gradlew file needs to be made executable. To do so, perform the following operation:

chmod 755 gradlew

Task 1

Run the tests for the class SimpleCrawlerTest. You should have a sucessful build to pass the test.

On Linux:

./gradlew test --tests "SimpleCrawlerTest"

On macOS:

./gradlew test --tests "SimpleCrawlerTest"

On Windows:

.\gradlew test --tests "SimpleCrawlerTest"

Task 2

Run the tests for the class IndexFlipperTest, and then SearcherTest. You should have a sucessful build to pass the test.

On Linux:

./gradlew test --tests "IndexFlipperTest"
./gradlew test --tests "SearcherTestTest"

On macOS:

./gradlew test --tests "IndexFlipperTest"
./gradlew test --tests "SearcherTestTest"

On Windows:

.\gradlew test --tests "IndexFlipperTest"
.\gradlew test --tests "SearcherTestTest"

Task 3

Run the search engine and test it from a browser.

You should first configure the file application.properties in src/main/resources:

  • server.port defines the port.
  • crawler indicates the crawler to be used (simple for the SimpleCrawler and multithread for the MultithreadCrawler).
  • crawl is a boolean indicating whether the search engine should crawl the environment when starting.

To access the search engine, go to the URL: "http://localhost:{PORT}/", where PORT is the specified PORT. If the port is 80, you can just use: "http://localhost/".

On Linux:

./gradlew bootRun

On macOS:

./gradlew bootRun

On Windows:

.\gradlew bootRun

Task 4

Run the tests for the class MultithreadCrawlerTest. You should have a sucessful build to pass the test.

On Linux:

./gradlew test --tests "MultithreadCrawlerTest"

On macOS:

./gradlew test --tests "MultithreadCrawlerTest"

On Windows:

.\gradlew test --tests "MultithreadCrawlerTest"

assignment2's People

Contributors

jeremylemee avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.