-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
371: Add typo tolerance settings r=alallema a=alallema⚠️ This PR is a `WIP` it will be merged after the v0.27.0 This PR introduces the new setting: [typoTolerance](meilisearch/specifications#117) new methods: `index.getTypoTolerance()` `index.updateTypoTolerance(params)` `index.resetTypoTolerance()` Co-authored-by: alallema <amelie@meilisearch.com> Co-authored-by: Amélie <alallema@users.noreply.github.com>
- Loading branch information
Showing
9 changed files
with
395 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.meilisearch.sdk; | ||
|
||
import java.util.HashMap; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
import org.json.JSONObject; | ||
|
||
public class TypoTolerance { | ||
@Getter @Setter private boolean enabled = true; | ||
@Getter @Setter private HashMap<String, Integer> minWordSizeForTypos; | ||
@Getter @Setter private String[] disableOnWords; | ||
@Getter @Setter private String[] disableOnAttributes; | ||
|
||
/** | ||
* Method to return the JSONObject of the TypoTolerance Setting | ||
* | ||
* @return JSONObject of the TypoTolerance Setting object | ||
*/ | ||
public JSONObject toJson() { | ||
JSONObject jsonObject = new JSONObject(); | ||
jsonObject.put("enabled", this.enabled); | ||
jsonObject.put("minWordSizeForTypos", this.minWordSizeForTypos); | ||
jsonObject.put("disableOnWords", this.disableOnWords); | ||
jsonObject.put("disableOnAttributes", this.disableOnAttributes); | ||
return jsonObject; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.