Skip to content

Latest commit

 

History

History
74 lines (65 loc) · 1.81 KB

README.md

File metadata and controls

74 lines (65 loc) · 1.81 KB

Searchinator Search Engine

Frontend Setup

Node.JS is required to run the frontend.

npm start
---------
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits.
You will also see any lint errors in the console.

Backend Setup

  1. Install the requirements for the project.
pip install -r requirements.txt
  1. Install MongoDB
  2. Ensure the environmental variables include MongoDB.
  3. Run mongod to start the MongoDB server.
  4. In another terminal, run mongo to run the MongoDB CLI.
  5. Copy and paste the following to the CLI:
db.getCollection('kwic')
  .createIndex(
    {
      lookupKey: 1
      /*
       * Keys
       *
       * Normal index
       * fieldA:  1, //ascending
       * fieldB: -1  //descending
       *
       * Wildcard index
       * '$**': 1, //wildcard index on all fields and subfields in a document
       * 'path.to.field.$**': 1 //wildcard index on a specific field and its subpaths
       *
       * Text index
       * fieldA: 'text',
       * fieldB: 'text'
       *
       * Geospatial Index
       * locationField: '2dsphere'
       *
       * Hashed Index
       * fieldA: 'hashed'
       */
    }, {
      /*
       * Options (https://docs.mongodb.com/manual/reference/method/db.collection.createIndex/#options-for-all-index-types)
       *
       * background: true, //ignored in 4.2+
       * unique: false,
       * name: 'some name',
       * partialFilterExpression: {},
       * sparse: false,
       * expireAfterSeconds: TTL,
       * collation: {}
       */
    }
  );
  1. Run app.py to start the Flask server.
  2. Use Postman or run dummy_client.py to send requests to the server.