-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. support tft.explainscore command 2. fix tairsearch failed test case because of the change of score by using regexp
- Loading branch information
1 parent
a28d4d7
commit 366ea1d
Showing
8 changed files
with
286 additions
and
104 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
32 changes: 32 additions & 0 deletions
32
src/main/java/com/aliyun/tair/tairsearch/params/TFTExplainScoreParams.java
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 @@ | ||
package com.aliyun.tair.tairsearch.params; | ||
|
||
import redis.clients.jedis.util.SafeEncoder; | ||
|
||
import java.util.ArrayList; | ||
|
||
public class TFTExplainScoreParams { | ||
public byte[][] getByteParams(String key, String request, String... docIds) { | ||
ArrayList<byte[]> byteParams = new ArrayList<byte[]>(); | ||
|
||
byteParams.add(SafeEncoder.encode(key)); | ||
byteParams.add(SafeEncoder.encode(request)); | ||
|
||
for (String s : docIds) { | ||
byteParams.add(SafeEncoder.encode(s)); | ||
} | ||
|
||
return byteParams.toArray(new byte[byteParams.size()][]); | ||
} | ||
|
||
public byte[][] getByteParams(byte[] key, byte[] request, byte[]... docIds) { | ||
ArrayList<byte[]> byteParams = new ArrayList<byte[]>(); | ||
|
||
byteParams.add(key); | ||
byteParams.add(request); | ||
|
||
for (byte[] arg : docIds) { | ||
byteParams.add(arg); | ||
} | ||
return byteParams.toArray(new byte[byteParams.size()][]); | ||
} | ||
} |
Oops, something went wrong.