Skip to content

mongodb-developer/atlas-search-java-server

Repository files navigation

Atlas Search Server

A Java-based HTTP server GET interface for Atlas Search, supporting filtering, sorting, highlighting, pagination, and debugging.

This Search Server code was initially written to support the article "How to Build a Search Service in Java with MongoDB" and video[TBD].

Building and running locally

The jettyRun target is used and searches the movies_index. The search server code lives under server/

To run the search server locally, follow these steps:

movies_index configuration

{
  "analyzer": "lucene.english",
  "searchAnalyzer": "lucene.english",
  "mappings": {
    "dynamic": true,
    "fields": {
      "cast": [
        {
          "type": "token"
        },
        {
          "type": "string"
        },
        {
          "type": "stringFacet"
        }
      ],
      "genres": [
        {
          "type": "token"
        },
        {
          "type": "string"
        },
        {
          "type": "stringFacet"
        }
      ],
      "year": {
        "type": "numberFacet"
      }
    }
  }
}