51 検索API
ユーザーは、検索APIを使用して格納されたドキュメントを問い合せ、入力に基づいて関連する結果を取得できます。
Endpoint
http request
POST /api/kb/<storeName>/searchSample Request Payload
json
{
"query": "How can I implement PortableType in Coherence?",
"maxResults": 10,
"minScore": 0.7,
"fullTextWeight": 0.5,
"scoringModel": "-/ms-marco-TinyBERT-L-2-v2"
}
`scoringModel`および`minScore`属性はオプションです。`scoringModel`が指定されている場合は、結果の再ランク付けに使用され、最終的な再ランク付けされた結果のみが、`minScore`値(指定されている場合)に基づいてフィルタされます。
`fullTextWeight`プロパティもオプションであり、ハイブリッド検索の実行時に全文索引検索結果に割り当てる重みを指定できます。指定しない場合、ハイブリッド検索は無効になり、ベクトル検索結果のみが返されます。
Sample Response
json
{
"results": [
{
"chunkId": "https://docs.oracle.com/en/middleware/fusion-middleware/coherence/14.1.2/develop-applications/developing-applications-oracle-coherence.pdf#667",
"index": "VECTOR",
"score": 0.9987151461996925,
"text": "• Implement serialization code at compile-time using byte code instrumentation, ..."
},
{
"chunkId": "https://docs.oracle.com/en/middleware/fusion-middleware/coherence/14.1.2/develop-applications/developing-applications-oracle-coherence.pdf#665",
"index": "HYBRID",
"score": 0.9937246879336528,
"text": "• It's versionable. Objects can evolve and have forward and backward compatibility.\n\n..."
},
{
"chunkId": "https://docs.oracle.com/en/middleware/fusion-middleware/coherence/14.1.2/develop-remote-clients/developing-remote-clients-oracle-coherence.pdf#292",
"index": "FULL_TEXT",
"score": 0.981980053233071,
"text": "This section includes the following topic:\n\n• Creating a PortableObject Implementation (Java)\n\nCreating a PortableObject Implementation (Java)..."
},
...
{
"chunkId": "https://docs.oracle.com/en/middleware/fusion-middleware/coherence/14.1.2/develop-applications/developing-applications-oracle-coherence.pdf#668",
"index": "HYBRID",
"score": 0.7846571128300767,
"text": "Understanding Usage Basics\nThere are only two basic requirements for Portable Types:\n\n• The class must be annotated with the @PortableType annotation\n\n• The fields that should be serialized must be annotated with @Portable or..."
}
],
"searchDuration": 11
}