Coder Social home page Coder Social logo

meilisearch-java's Introduction

Meilisearch Java

Meilisearch Java

Version Tests License Bors enabled Code Coverage

⚡ The Meilisearch API client written for Java ☕️

Meilisearch Java is the Meilisearch API client for Java developers.

Meilisearch is an open-source search engine. Learn more about Meilisearch.

Table of Contents

📖 Documentation

This readme contains all the documentation you need to start using this Meilisearch SDK.

For general information on how to use Meilisearch—such as our API reference, tutorials, guides, and in-depth articles—refer to our main documentation website.

⚡ Supercharge your Meilisearch experience

Say goodbye to server deployment and manual updates with Meilisearch Cloud. Get started with a 14-day free trial! No credit card required.

🔧 Installation

meilisearch-java is available from JCentral official repository. To be able to import this package, declare it as a dependency in your project:

Maven

Add the following code to the <dependencies> section of your project:

<dependency>
  <groupId>com.meilisearch.sdk</groupId>
  <artifactId>meilisearch-java</artifactId>
  <version>0.13.0</version>
  <type>pom</type>
</dependency>

Gradle

Add the following line to the dependencies section of your build.gradle:

implementation 'com.meilisearch.sdk:meilisearch-java:0.13.0'

⚠️ meilisearch-java also requires okhttp as a peer dependency.

Run Meilisearch

There are many easy ways to download and run a Meilisearch instance.

For example, using the curl command in your Terminal:

 # Install Meilisearch
 curl -L https://install.meilisearch.com | sh

 # Launch Meilisearch
 ./meilisearch --master-key=masterKey

NB: you can also download Meilisearch from Homebrew or APT or even run it using Docker.

🚀 Getting started

Add documents

package com.meilisearch.sdk;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.ArrayList;

class TestMeilisearch {
  public static void main(String[] args) throws Exception {

    JSONArray array = new JSONArray();
    ArrayList items = new ArrayList() {{
      add(new JSONObject().put("id", "1").put("title", "Carol").put("genres",new JSONArray("[\"Romance\",\"Drama\"]")));
      add(new JSONObject().put("id", "2").put("title", "Wonder Woman").put("genres",new JSONArray("[\"Action\",\"Adventure\"]")));
      add(new JSONObject().put("id", "3").put("title", "Life of Pi").put("genres",new JSONArray("[\"Adventure\",\"Drama\"]")));
      add(new JSONObject().put("id", "4").put("title", "Mad Max: Fury Road").put("genres",new JSONArray("[\"Adventure\",\"Science Fiction\"]")));
      add(new JSONObject().put("id", "5").put("title", "Moana").put("genres",new JSONArray("[\"Fantasy\",\"Action\"]")));
      add(new JSONObject().put("id", "6").put("title", "Philadelphia").put("genres",new JSONArray("[\"Drama\"]")));
    }};

    array.put(items);
    String documents = array.getJSONArray(0).toString();
    Client client = new Client(new Config("http://localhost:7700", "masterKey"));

    // An index is where the documents are stored.
    Index index = client.index("movies");

    // If the index 'movies' does not exist, Meilisearch creates it when you first add the documents.
    index.addDocuments(documents); // => { "taskUid": 0 }
  }
}

With the taskUid, you can check the status (enqueued, canceled, processing, succeeded or failed) of your documents addition using the task endpoint.

Basic Search

A basic search can be performed by calling index.search() method, with a simple string query.

import com.meilisearch.sdk.model.SearchResult;

// Meilisearch is typo-tolerant:
SearchResult results = index.search("carlo");
System.out.println(results);
  • Output:
SearchResult(hits=[{id=1.0, title=Carol, genres:[Romance, Drama]}], offset=0, limit=20, estimatedTotalHits=1, facetDistribution=null, processingTimeMs=3, query=carlo)

Custom Search

If you want a custom search, the easiest way is to create a SearchRequest object, and set the parameters that you need.
All the supported options are described in the search parameters section of the documentation.

import com.meilisearch.sdk.SearchRequest;

// ...

SearchResult results = index.search(
  new SearchRequest("of")
  .setShowMatchesPosition(true)
  .setAttributesToHighlight(new String[]{"title"})
);
System.out.println(results.getHits());
  • Output:
[{
  "id":3,
  "title":"Life of Pi",
  "genres":["Adventure","Drama"],
  "_formatted":{
    "id":3,
    "title":"Life <em>of</em> Pi",
    "genres":["Adventure","Drama"]
  },
  "_matchesPosition":{
    "title":[{
      "start":5.0,
      "length":2.0
    }]
  }
}]

Custom Search With Filters

If you want to enable filtering, you must add your attributes to the filterableAttributes index setting.

index.updateFilterableAttributesSettings(new String[]
{
  "id",
  "genres"
});

You only need to perform this operation once.

Note that Meilisearch will rebuild your index whenever you update filterableAttributes. Depending on the size of your dataset, this might take time. You can track the process using the task status.

Then, you can perform the search:

index.search(
  new SearchRequest("wonder")
  .setFilter(new String[] {"id > 1 AND genres = Action"})
);
{
  "hits": [
    {
      "id": 2,
      "title": "Wonder Woman",
      "genres": ["Action","Adventure"]
    }
  ],
  "offset": 0,
  "limit": 20,
  "estimatedTotalHits": 1,
  "processingTimeMs": 0,
  "query": "wonder"
}

🛠 Customization

JSON

Default JSON GsonJsonHandler

The default JSON library is Gson. You can however use another library with the JsonHandler Class.

Notes: We strongly recommend using the Gson library.

Using JacksonJsonHandler

Initialize your Config and assign it a new JacksonJsonHandler object as JsonHandler. Set up your Client with it.

import com.meilisearch.sdk.json.JacksonJsonHandler;

Config config = new Config("http://localhost:7700", "masterKey", new JacksonJsonHandler());
Client client = new Client(config);

Use a Custom JsonHandler

To create your own JSON handler, you must conform to the JsonHandler interface by implementing its two methods.

    String encode(Object o) throws Exception;

    <T> T decode(Object o, Class<?> targetClass, Class<?>... parameters) throws Exception;

Then create your client by initializing your Config with your new handler.

Config config = new Config("http://localhost:7700", "masterKey", new myJsonHandler());
Client client = new Client(config);

🤖 Compatibility with Meilisearch

This package guarantees compatibility with version v1.x of Meilisearch, but some features may not be present. Please check the issues for more info.

💡 Learn more

The following sections in our main documentation website may interest you:

⚙️ Contributing

Any new contribution is more than welcome in this project!

If you want to know more about the development workflow or want to contribute, please visit our contributing guidelines for detailed instructions!


Meilisearch provides and maintains many SDKs and Integration tools like this one. We want to provide everyone with an amazing search experience for any kind of project. If you want to contribute, make suggestions, or just know what's going on right now, visit us in the integration-guides repository.

meilisearch-java's People

Contributors

alallema avatar amei34 avatar ansavanix avatar axelrindle avatar bors[bot] avatar brunoocasali avatar curquiza avatar dennxa avatar dependabot-preview[bot] avatar dependabot[bot] avatar diegonavarroq avatar eskombro avatar ezienecker avatar irenejoeunpark avatar jd2024 avatar johandelvallev avatar jrhenderson1988 avatar junghoon-vans avatar kination avatar kuruvasatya avatar larskristianhaga avatar luis-valdez avatar meili-bors[bot] avatar meili-bot avatar mesutgk15 avatar nicolasvienot avatar niemannd avatar oraliahdz avatar the-sinner avatar vishnugt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

meilisearch-java's Issues

A better way to add documents in the Getting Started example?

Currently, here is the way to add documents we show in the first Getting Started example:

final String documents = "["
	+ "{\"book_id\": 123, \"title\": \"Pride and Prejudice\"},"
	+ "{\"book_id\": 456, \"title\": \"Le Petit Prince\"},"
	+ "{\"book_id\": 1, \"title\": \"Alice In Wonderland\"},"
	+ "{\"book_id\": 1344, \"title\": \"The Hobbit\"},"
	+ "{\"book_id\": 4, \"title\": \"Harry Potter and the Half-Blood Prince\"},"
	+ "{\"book_id\": 2, \"title\": \"The Hitchhiker\'s Guide to the Galaxy\"}"
	+ "]";

We would like to use, if it exists, a more friendly way to add documents that we can introduce into our Getting Started, instead of escaping double-quotes.

Maybe we could be inspired by the Stripe Java client and the HashMap solution, but it might also involve lots of lines, and this solution might be "heavy" too.
https://github.com/stripe/stripe-java#usage

What do you think?
Does someone know a way to make the Getting Started example more friendly? 😄

Add errors to updateStatus Class

An update status contains, in case of failure, relevant information about the error (message, code and a link to the description of the error in the docs) that should be added to the UpdateStatus for further usage in this SDK and for users!

Example of a failed update:

{
"status":"failed",
"updateId":1,
"type": {
  "name":"DocumentsAddition",
  "number":2
},
"duration":2.55E-5,
"enqueuedAt":"2020-09-28T20:17:27.005486800Z",
"processedAt":"2020-09-28T20:17:27.016900700Z",
"errorCode":"missing_document_id",
"errorType":"invalid_request_error",
"errorLink":"https://docs.meilisearch.com/errors#missing_document_id"
}

Generic class for search results

In the current state of the Java SDK, the return value of the search method is a String, which needs to be deserialized by the user after performing a search.

This SDK should provide a generic class capable of deserializing MeiliSearch results. Search method should return an instance of this object, with MeiliSearch's results already deserialized.

Implement changes due to implicit index creation

Related to meilisearch/integration-guides#48

  • Change the Getting Started as described in the main issue.
  • get_index() does an HTTP call and is not the main method to use anymore.
  • Add the index() method
  • Add tests for index() method
  • Update get_or_create_index with the new way of using index()
  • Add a fetchPrimaryKey() method to Index class. The attribute primaryKey is not updated when using the index() method: the method does not do any HTTP call. Refer to the limitation section in the main issue.

Create Javadoc and Sources

Due to the changes made to the build.gradle (updating to maven-publish), the build and publish tasks don't create the javadoc and sources anymore.

This is needed by the Central Repository to publish a package.

Choose a linter and integrate it to CI and docs

  • Choose a well maintained and known Linter for Java
  • Run the linter for the whole SDK code and make a Pull Request
  • Add a task in the CI [GitHub Actions] that runs automatically the linter (Lint will be required for any merge/contribution afterwards)

Do not hesitate to contact us if you have any doubts or questions!

CreateIndex should return an Index instance

In the current implementation, getIndex() returns an Index instance, but createIndex() returns the response of the POST request for creating an index. This forces a usage that looks like this:

...
String i = ms.createIndex(indexUid);
Index index = ms.getIndex(indexUid);
index.addDocuments(...)
...

In case createIndex succeeds, it should return an Index instance which simplifies the usage to

...
Index index = ms.createIndex(indexUid);
index.addDocuments(...)
...

In case of error, this will be handled by #7

Managing parameter input

Currently, it needs to generate json -> string for POST:

Indexes book = ms.getIndex("books");
        
JsonArray jsonArray = new JsonArray();
JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("1111", "alice in wonderland");
jsonArray.add(jsonObject);

// add new document "[{"1111": "alice in wonderland"}]"
String response = book.addDocument(jsonObject.toString());

To make this simple:

  1. Accept JSON modules(Gson, Jackson, ...) as input
  2. Create custom input format(it will use JSON module internally to convert input into JSON format)

Add documentation on Search

Inspired on our PHP SDK's search wiki, this document can specify features about search as the different methods exposed to the user (search() and rawSearch(), different constructors for this methods etc...

The repo's README can have a link to this WIKI in the Custom Search section as in this PHP README example

Create and fill sample file to display Java examples in MeiliSearch Documentation

Code Samples for MeiliSearch documentation

Introduction

As MeiliSearch grows so does its SDK's. More and more SDK's rises from the ground and they all deserve to be as well documented as the core engine itself.

The most common way for a user to understand MeiliSearch is to go to its official documentation. As of yesterday all examples in the documentation were made with cURL. Unfortunately, most of our users do not communicate with MeiliSearch directly with cURL. Which forces them to search for the specific references somewhere else (in the readme's, in the sdk's code itself,..). This makes for unnecessary friction.

Goal

We want our documentation to include all SDK's

As a first step we want all examples to be made using the most possible SDK's. As did Stripe and Algolia.

sdk_sample

examples with curl, javascript and soon enough this SDK too!

To achieve this it is expected from this SDK to create a sample file containing all the code samples needed by the documentation.

These are the steps to follow:

  • Create your sample file
  • Fill your sample file
  • Add your samples to the documentation

Create your sample file

The sample file is a yaml file added at the root of each MeiliSearch SDK.
Sample files are created based on the sample-template.yaml file.

sample-template file:

get_one_index_1: |-
list_all_indexes_1: |-
create_an_index_1: |-
...

This template is accessible publicly here or in the public directory : .vuepress/public/sample-template.yaml of the documentation.

The name of the file should be .code-samples.meilisearch.yaml

Fill your sample file

After creating the sample file with the content of the sample template you should have a file containing all the sampleId's.

get_one_index_1: |-
list_all_indexes_1: |-
create_an_index_1: |-
...

By the name of the different sampleId you should know where that code sample will be added to the documentation.

For example, create_an_index_1 is the first example in the API References of the index creation.

Using the already existing cURL example in the documentation you should see what is expected from that sample. It is very important that you look at the already existing samples in the documentation as it gives you the parameters to use in your sample to match with the rest of the documentation.

Good sample based on documentation:

create_an_index_1: |-
  client.createIndex({ uid: 'movies' })

Bad sample that does not match with the response.

create_an_index_1: |-
  client.createIndex({ uid: 'otherName' })

Each sample is expected to be written in the respective SDK language.

Javascript example:

get_one_index_1: |-
  client.getIndex('movies').show()
list_all_indexes_1: |-
  client.listIndexes()
create_an_index_1: |-
  client.createIndex({ uid: 'movies' })
  ...

The complete cURL sample file is available at the root of the documentation repository.
Every other SDK sample file should be available at the root of their respective repository.

Formatting Exception

There is one exception to the formatting rule.
When the sampleId finishes with _md it means it is expected to be written in markdown format.

JavaScript sample id with _md extension:
yaml-js-example

Add your samples to the documentation

Once your sample file is filled with the code samples, you will need to create a pull request on the documentation repository.

Open the following file in your IDE:
.vuepress/code-samples/sdks.json

And add your sample file to the list:

[
  ...
  {
    "language": "sdk-language",
    "label": "sdk-label",
    "url": "url to yaml file"
  }
]

The language key expect a supported language for the code highlight.

The label key is the name of the tab. While label and language could have been the same, it created some conflict (i.e: bash and cURL).

The url is the raw link to access your sample file. It should look like this:
https://raw.githubusercontent.com/[PROJECT]/[REPO]/.code-samples.meilisearch.yaml

Add facetsDistribution in SearchRequest

Description
Add facetsDistribution as query parameter in SearchRequest.

Basic example

SearchRequest searchRequest = new SearchRequest("knight")
	.setFacetsDistribution(new String[]{"*"});
new SearchRequest("prince", 200, 900, new String[]{"bubble"}, new String[]{"crop"}, 900, new String[]{"highlight"}, "tag='romance'", true, new String[]{"title"});

Document the customizations

If I understand well, this library provides default usage but also provides abstractions to choose and customize:

  • the JSON library
  • the Client
  • the HTTP requests

It would be nice to add a section in the README to show with simple lines of code how to customize all of these points 🙂

Modify addDocument -> addDocuments method (to support multiple documents)

To add documents to MeiliSearch the API requires a JSON object composed of an array of documents, either if you are sending one or multiple documents in the same request. In this case we need a method called addDocuments taking a list of documents as a parameter. This method can handle a single document in the exact same way. It would probably be better to replace the addDocument method

Create and fill sample file to display Java examples in MeiliSearch Documentation

Code Samples for MeiliSearch documentation

Introduction

As MeiliSearch grows so does its SDK's. More and more SDK's rises from the ground and they all deserve to be as well documented as the core engine itself.

The most common way for a user to understand MeiliSearch is to go to its official documentation. As of yesterday all examples in the documentation were made with cURL. Unfortunately, most of our users do not communicate with MeiliSearch directly with cURL. Which forces them to search for the specific references somewhere else (in the readme's, in the sdk's code itself,..). This makes for unnecessary friction.

Goal

We want our documentation to include all SDK's

As a first step we want all examples to be made using the most possible SDK's. As did Stripe and Algolia.

sdk_sample

examples with curl, javascript and soon enough this SDK too!

To achieve this it is expected from this SDK to create a sample file containing all the code samples needed by the documentation.

These are the steps to follow:

  • Create your sample file
  • Fill your sample file
  • Add your samples to the documentation

Create your sample file

The sample file is a yaml file added at the root of each MeiliSearch SDK.
Sample files are created based on the sample-template.yaml file.

sample-template file:

get_one_index_1: |-
list_all_indexes_1: |-
create_an_index_1: |-
...

This template is accessible publicly here or in the public directory : .vuepress/public/sample-template.yaml of the documentation.

The name of the file should be .code-samples.meilisearch.yaml

Fill your sample file

After creating the sample file with the content of the sample template you should have a file containing all the sampleId's.

get_one_index_1: |-
list_all_indexes_1: |-
create_an_index_1: |-
...

By the name of the different sampleId you should know where that code sample will be added to the documentation.

For example, create_an_index_1 is the first example in the API References of the index creation.

Using the already existing cURL example in the documentation you should see what is expected from that sample. It is very important that you look at the already existing samples in the documentation as it gives you the parameters to use in your sample to match with the rest of the documentation.

Good sample based on documentation:

create_an_index_1: |-
  client.createIndex({ uid: 'movies' })

Bad sample that does not match with the response.

create_an_index_1: |-
  client.createIndex({ uid: 'otherName' })

Each sample is expected to be written in the respective SDK language.

Javascript example:

get_one_index_1: |-
  client.getIndex('movies').show()
list_all_indexes_1: |-
  client.listIndexes()
create_an_index_1: |-
  client.createIndex({ uid: 'movies' })
  ...

The complete cURL sample file is available at the root of the documentation repository.
Every other SDK sample file should be available at the root of their respective repository.

Formatting Exception

There is one exception to the formatting rule.
When the sampleId finishes with _md it means it is expected to be written in markdown format.

JavaScript sample id with _md extension:
yaml-js-example

Add your samples to the documentation

Once your sample file is filled with the code samples, you will need to create a pull request on the documentation repository.

Open the following file in your IDE:
.vuepress/code-samples/sdks.json

And add your sample file to the list:

[
  ...
  {
    "language": "sdk-language",
    "label": "sdk-label",
    "url": "url to yaml file"
  }
]

The language key expect a supported language for the code highlight.

The label key is the name of the tab. While label and language could have been the same, it created some conflict (i.e: bash and cURL).

The url is the raw link to access your sample file. It should look like this:
https://raw.githubusercontent.com/[PROJECT]/[REPO]/.code-samples.meilisearch.yaml

Add a check-release script

Currently, there is no check that the version of the package that will be published match the release tag.
We want to implement the check when the publish workflow is triggered (ossrh-publish.yml)

⚠️ Should be done by a MeiliSearch team member.

Lacking genericity

The wrapper lacks genericity a lot: for the moment each data it returns is a string and must be parsed by the program using the wrapper.
We should implement generic methods allowing to retrieve dynamically mapped types rather than simply strings.

Improve SDK automated documentation [javadoc]

meilisearch-java uses javadoc as a documentation generator, which is based on comments on the code. There are several classes, methods, and attributes that are very useful for developers who use our SDK that have no comment, and therefore no automated documentation.

Several warnings are shown when your build includes the task javadoc. It would be interesting to add some documentation to the most important classes and methods, and to suppress the warnings of those who do not need to be documented.

This is a good first issue to understand the project, and how it is plugged to MeiliSearch

Note: This doesn't need to be solved all in one single PR, any partial contribution would be appreciated.


I would say that the most important is to add the appropriate comments to the main classes: Client, Index, Search, SearchRequest and it's main methods with a short description of the method, params, return values and Exceptions

As an example:

/**
 * Wait for a pending update to be processed
 *
 * @param updateId ID of the index update
 * @param timeoutInMs number of milliseconds before throwing an Exception
 * @param intervalInMs number of milliseconds before requesting the status again
 * @throws Exception if timeout is reached
 */
public void waitForPendingUpdate(int updateId, int timeoutInMs, int intervalInMs) throws Exception {
	// ...
}

Add a CONTRIBUTING.md

Create a nice welcoming file for new contributors, specifying every detail, and especially the developer workflow, and how to test, lint and release (whenever we have tests and linters etc...).

It can be inspired in our SDKs CONTRIBUTING.md files, such as this or this

Implement a method to delete a batch of documents

The implementation for this route letting the user delete a batch of documents by providing a list of document ids is missing from the SDK.

Method names should be explicit, for making the difference obvious, like deleteAllDocuments() and deleteDocuments([...]) (these are the method names used in other MeiliSearch SDKs)

  • Implement the method for deleting a batch of documents as deleteDocuments([...])
  • Rename the deleteDocuments method (which currently deletes all documents) to deleteAllDocuments()
  • Add tests for deleteDocuments()

Update README

  • Quickstart
  • API table
  • Installation guide
  • Description

Add a LICENSE

Include a copy if the MIT License in the root of the repo

Change the trigger in the publish workflow

Currently, the trigger for the publish workflow is based on the name of the tag on push.
We want to trigger the workflow on release, irrespective of the tag.

⚠️ Should be done by a MeiliSearch team member.

Change master branch to main

Let's be allies and make this change that means a lot.

Here is a blog post that explain a little more why it's important, and how to easily do it. It will be a bit more complicated with automation, but we still should do it!

updateIndex method should return an Index instance

To be consistent with createIndex and getIndex, the method updateIndex should return an Index instance. This method should update the primaryKey attribute of the Index instance with the information returned by MeiliSearch.

  • Update the code base
  • Add tests

EDIT: this PR (#74) should have been merged before.

Implement ServiceTemplates on SDK

#92 Introduces the ServiceTemplate, which makes the API implementation independent from the HTTP Client and JSON handler. This level of abstraction is not yet used by the SDK and will probably introduce breaking changes.

Document this implementation

Test placeholder search

Placeholder search lets the user send a null query parameter in order to apply all the ranking rules to the documents in the index without matching them with a specific query, and return the results to the user. It is different to sending an empty string as a query, in which case you won't receive any results. This behavior should be explicitly tested in the SDK.

More info about Placeholder search here


UPDATE:

Placeholder works 👍

Placeholder Search can be used by:

  • Using a null query: q=null
  • Using an empty String: q=""

Tests are still missing (both options, null and empty String, should be tested).

[Enconding UTF-8 BasicHttpRequest] Am I missing something with encoding ?

Hello,
I'm facing an issue here, i have meilisearch running in a docker container (last image)
I use meilisearch-java 0.2.0.

I have a doc.json encoded in UTF-8 that contains © and … "spécial" characters.
[{"id":1,"content":"© hop"},{"id":2,"content":"… hop"}]

The following command line is working perfectly as expected.

$ curl  -H "X-Meili-API-Key: masterKey" -X POST 'http://127.0.0.1:7700/indexes/kiki/documents'   --data @doc.json
{"updateId":0}

The following line using meilisearch-java is returning an error:
index.addDocuments("[{\"id\":1,\"content\":\"© hopaaa\"},{\"id\":2,\"content\":\"… hop\"}]")
Invalid JSON: invalid unicode code point at line 1 column 29

image

I have this problem with all the UTF8 html file i'm trying to index... and it's driving me a bit crazy.
What am i missing? Could this be a bug ?

Implement settings methods

There are 3 main methods that are missing in this package. If I'm wrong, feel free to close this issue, but I don't find anything when I search for settings in this repository.

The updateSettings route should be able to work even if all the settings (rankingRules, distinctAttribute, synonyms...) are not all passed. A similar implementation to the SearchRequest class with all the setXXX methods for the Settings class could be useful: https://github.com/meilisearch/meilisearch-java/blob/2b042ada803cd207730b85db4e10157a9ed3d923/src/main/java/com/meilisearch/sdk/SearchRequest.java.

Steps:

  • Add the Settings class with all the needed methods
  • Add the 3 settings methods (get, update, reset)
  • Add tests

Feel free to ask any question if something is not clear to you 🙂

Rename addDocument method to addDocuments

The HTTP API for indexing documents takes always a JSON array of documents as a parameter, either if you want to index a single document or a batch. In which case we should probably expose just a single method for both, and rename it in its plural way as addDocuments(...) :)

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.