full_text_search
Function
Searches for document information in a relational database. If enable_bm25 is set to False when an OpenGaussDocstore instance is created, this API cannot be used, and an empty list is returned.
Prototype
def full_text_search(query, top_k, filter_dict) -> List[MxDocument]
Parameters
Parameter |
Data Type |
Required/Optional |
Description |
|---|---|---|---|
query |
String |
Required |
Text to be retrieved. The length range is (0, 1000 × 1000]. |
top_k |
Integer |
Optional |
Number of most matched chunks. The default value is 3. If the value of this parameter is greater than the number of valid chunks found, only valid chunks are returned. The value range is (0, 10000]. |
filter_dict |
Dict |
Required |
Dictionary consisting of retrieval criteria. Currently, only document IDs can be filtered. The filtered document IDs are passed in a list. The length of the ID list cannot exceed 1000 × 1000. For example, if you need to filter the documents whose IDs are 1, 2, and 4, the input dictionary is {"document_id": [1, 2, 4]}. |
Return Value
Data Type |
Description |
|---|---|
List[MxDocument] |
If a result is found, a list of MxDocument class instances is returned. If no result is found, an empty list is returned. For details about MxDocument, see MxDocument. If enable_bm25 is set to False, [] is returned. |