forked from opensearch-project/k-NN
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial commit for integrating Faiss index as a standalone index per …
…shard Signed-off-by: Navneet Verma <navneev@amazon.com>
- Loading branch information
Showing
4 changed files
with
69 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.opensearch.knn.service; | ||
|
||
import org.opensearch.knn.jni.FaissService; | ||
|
||
import java.util.Map; | ||
|
||
public class FaissIndex { | ||
|
||
private long memoryAddress = 0; | ||
|
||
// We should be calling this only once. Ideally we should call this once when the shard is getting created. | ||
// We will figure out a way to do this, later | ||
public void initIndex(int dim, Map<String, Object> parameters) { | ||
memoryAddress = FaissService.initIndex(0, dim , parameters); | ||
} | ||
|
||
public void indexData(int docId, float[] vector) { | ||
|
||
} | ||
|
||
public void searchIndex(float[] queryVector, int k) { | ||
|
||
} | ||
|
||
|
||
|
||
} |
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