Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

FEAT: support cosine similarity #90

Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
99cc16c
MNT: pass in spaceType in jni cpp
chenqi0805 Apr 12, 2020
6375d49
MNT: pass in spaceType in jni java
chenqi0805 Apr 12, 2020
28f33f9
Regenerate header file
chenqi0805 Apr 12, 2020
784e67f
Regenerate jnilib
chenqi0805 Apr 12, 2020
d29cabd
ADD: spacetype into KNN settings
chenqi0805 Apr 12, 2020
bde898c
Update vector field mapper
chenqi0805 Apr 12, 2020
0bdf53e
Pass in spaceType in consumer
chenqi0805 Apr 12, 2020
25cafe9
ADD: spaceType param into constant
chenqi0805 Apr 12, 2020
2920f5b
fix loadIndex in cache
chenqi0805 Apr 12, 2020
a9388a9
FIX: existing test cases
chenqi0805 Apr 12, 2020
8a58bf6
Update jni external library
chenqi0805 Apr 12, 2020
de8271d
FIX: release jstring and char array
chenqi0805 Apr 14, 2020
c49efaf
Rename test file and added a consinesimil test
chenqi0805 Apr 14, 2020
ce2660f
update .jnilib
chenqi0805 Apr 14, 2020
2c10607
Rename file
chenqi0805 Apr 14, 2020
65052c8
Rename file
chenqi0805 Apr 14, 2020
3eb7a47
Compile .so
chenqi0805 Apr 14, 2020
aa26cfb
Compile .so on linux
chenqi0805 Apr 14, 2020
18a8406
TST: IT on invalid spaceType settings
chenqi0805 Apr 15, 2020
5ebb930
Merge branch 'feat/28-cosine-similarity' of github.com:chenqi0805/k-N…
chenqi0805 Apr 15, 2020
635c7b1
Unused import
chenqi0805 Apr 15, 2020
83e4a90
Update README
chenqi0805 Apr 15, 2020
e858038
MNT: null check on spacetype
chenqi0805 Apr 17, 2020
6cbfc79
REF: SpaceTypes
chenqi0805 Apr 17, 2020
66cbbe8
MNT: arg order in jni
chenqi0805 Apr 17, 2020
c852d84
Compile .so
chenqi0805 Apr 17, 2020
0394e93
MNT: update readme on settings and experimental section
chenqi0805 Apr 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
TST: IT on invalid spaceType settings
chenqi0805 committed Apr 15, 2020
commit 18a84068eccdca5eaa06ae88e27bbb29bdcf785e
Original file line number Diff line number Diff line change
@@ -17,8 +17,12 @@

import org.elasticsearch.client.Response;
import org.elasticsearch.client.ResponseException;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.RestStatus;

import java.io.IOException;
import java.security.InvalidParameterException;

import static org.hamcrest.Matchers.containsString;

public class KNNESSettingsTestIT extends KNNRestTestCase {
@@ -70,5 +74,18 @@ public void testQueriesPluginDisabled() throws Exception {
updateClusterSettings(KNNSettings.KNN_PLUGIN_ENABLED, true);
searchKNNIndex(INDEX_NAME, new KNNQueryBuilder(FIELD_NAME, qvector, 1), 1);
}

public void testCreateIndexWithInvalidSpaceType() throws IOException {
String invalidSpaceType = "bar";
Settings invalidSettings = Settings.builder()
.put("number_of_shards", 1)
.put("number_of_replicas", 0)
.put("index.knn", true)
.put("index.knn.space_type", invalidSpaceType)
.build();
Exception ex = expectThrows(ResponseException.class,
() -> createKnnIndex(INDEX_NAME, invalidSettings, createKnnIndexMapping(FIELD_NAME, 2)));
assertThat(ex.getMessage(), containsString(String.format("Unsupported space type: %s", invalidSpaceType)));
}
}