Giter Club home page Giter Club logo

docs-search-transport's Introduction

MongoDB Documentation Search Indexer & Query Server

REST server that indexes search documents within an Atlas cluster and handles user search requests, deployed via Kanopy

Components

Marian Server

REST server that exposes endpoints to run queries against Atlas DB.

Atlas Admin Manager

Module to invoke Atlas Admin commands via the Atlas Admin API, specifically manages the Atlas Search Index for Search DB.

Search Index

Service to read and write from Atlas DB. Transports input manifest documents into Atlas DB. Also reads DB results for server requests and returns formatted responses.

Query

Query class that builds aggregation operations based off request query parameters.

Installation

npm install

Create a .env file and copy over the contents of sample.env. Some values may have to be added or replaced. If adding a new environment variable, please add the name and a sample value to the sample.env.

Running locally

$ npm run build
$ npm run search-transport

The server will be running on port 8080. To make a query, make a request to localhost:8080/search?q=<your query here> using the browser, Postman, etc.

Available query parameters:

  • (required) q - string to be queried (e.g. findbyidandupdate)
  • (optional) searchProperty - which docs property the query should be refined by (e.g. manual)
  • (optional) page - which page of results to display (e.g. 2)
  • (optional) facets.target_product>product>sub_product or facets.target_product - a list of selected facets/subfacets

A request might look like http://localhost:8080/search/?q=filter&facets.target_product=atlas&facets.target_product>atlas>sub_product=atlas-app-services.

A node debugger (ie. chrome developer tools) can be connected to the built JS files.

Staging

All commits pushed to a branch with branchname DOP-* will be deployed to the dev instance of search transport. The dev instance is viewable at https://docs-search-transport-dev.docs.staging.corp.mongodb.com/status

All commits merged to main deploy via Kanopy to a staging instance. The staging instance is viewable at https://docs-search-transport.docs.staging.corp.mongodb.com/status.

Releasing

New release tags automatically begin deployment via Kanopy to production instances.

Cutting a release with a new tag via the Github UI is the recommended method of deploying to production. As a matter of practice, release tags should be cut from main.

Testing

Tests can be run using:

npm test  # alias for npm run test

Unit tests

Tests are located in the tests directory, and run via mocha.

npm run test

Linting & Style

We use ESLint and Prettier to help with linting and style.

Lint

npm run lint:fix

Style

To format code using Prettier, run the following command:

npm run format:fix

We have set up a precommit hook that will format staged files. Prettier also offers a variety of editor integrations to automatically format your code.

docs-search-transport's People

Contributors

anabellabuckvar avatar bianca-laube avatar branberry avatar caesarbell avatar casthewiz avatar i80and avatar mayaraman19 avatar mmeigs avatar rayangler avatar rkhullar-mongodb avatar sarahemlin avatar schmalliso avatar seungpark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.