GithubHelp home page GithubHelp logo

mongodb-developer / getting-started-search-java Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 134 KB

A demo application for getting started with Atlas Search.

License: Apache License 2.0

Java 100.00%
atlas atlas-search java mongodb mongodb-atlas mongodb-java-driver

getting-started-search-java's Introduction

Getting Started with Atlas Search in Java

This repository contains examples of using Atlas Search with Java.

The First Search Example code was written for the article "Using Atlas Search From Java".

This example uses the run target and searches the default index.

In order to run the FirstSearchExample, follow these steps:

Questions?

Questions about this repo or how to use Atlas Search and Java together? Ask them in the MongoDB Community.

getting-started-search-java's People

Contributors

erikhatcher avatar mohit-sharma-87 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

getting-started-search-java's Issues

Some comments

  • Which version of Java are you targeting ? This doesn't seem explicit in the build.gradle.
  • Why is index_config.json in the webapp folder? It's just here for reference, no? Move this in the README.md instead?
  • It's not clear to me why you have 2 files FirstSearchExample and SearchServlet? Looks like the blog post is just about the servlet one so why keep the other one in the code?
  • Logger improvements:
private static final Logger LOGGER = LoggerFactory.getLogger(MasterKeyServiceImpl.class);
then 
LOGGER.info("=> Person not found: {}", e.toString());
  • fix some warnings
    image

image

Looks like the "close" of the MDB connection isn't handled correctly when the program stops

image

  • Don't use Arrays.asList if you are using List.of in some places. Prefer List.of in my opinion now.

image

image

I know it's not true because you have handled the errors but try to reorg the code a little bit so Java knows that maybe are removed the false warning?

  • I think I would make some methods to make the code easier to read.

image

  • some code unused on purpose?
    image

TextSearchOperator is expecting SearchPath but we don't have the option to send that value as parameter

@erikhatcher , Can you please help me with the example to pass the value to this below method,
image

Do you think the parameter to be changed from SearchPath to FieldSearchPath to pass the parameter to this method like this,
SearchOperator.of(SearchOperator.text(SearchPath.fieldPath(fieldName), fieldValue));

Compilation Error : The method text(SearchPath, String) in the type SearchOperator is not applicable for the arguments (FieldSearchPath, Object)

Please help me on this.

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.