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].
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:
- Add the sample collections to your Atlas cluster
- If you're not already an Atlas user, get started with Atlas
- Create an Atlas Search index on the
movies
collection, namedmovies_index
, using the index configuration below. - Run the search service:
ATLAS_URI="<<insert your connection string here>>" ./gradlew jettyRun
- Visit http://localhost:8080
{
"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"
}
}
}
}