| @@ 649-675 (lines=27) @@ | ||
| 646 | return invalid_vectors |
|
| 647 | ||
| 648 | ||
| 649 | def gen_invaild_search_params(): |
|
| 650 | invalid_search_key = 100 |
|
| 651 | search_params = [] |
|
| 652 | for index_type in all_index_types: |
|
| 653 | if index_type == "FLAT": |
|
| 654 | continue |
|
| 655 | search_params.append({"index_type": index_type, "search_params": {"invalid_key": invalid_search_key}}) |
|
| 656 | if index_type in delete_support(): |
|
| 657 | for nprobe in gen_invalid_params(): |
|
| 658 | ivf_search_params = {"index_type": index_type, "search_params": {"nprobe": nprobe}} |
|
| 659 | search_params.append(ivf_search_params) |
|
| 660 | elif index_type in ["HNSW", "RHNSW_PQ", "RHNSW_SQ"]: |
|
| 661 | for ef in gen_invalid_params(): |
|
| 662 | hnsw_search_param = {"index_type": index_type, "search_params": {"ef": ef}} |
|
| 663 | search_params.append(hnsw_search_param) |
|
| 664 | elif index_type == "NSG": |
|
| 665 | for search_length in gen_invalid_params(): |
|
| 666 | nsg_search_param = {"index_type": index_type, "search_params": {"search_length": search_length}} |
|
| 667 | search_params.append(nsg_search_param) |
|
| 668 | search_params.append({"index_type": index_type, "search_params": {"invalid_key": 100}}) |
|
| 669 | elif index_type == "ANNOY": |
|
| 670 | for search_k in gen_invalid_params(): |
|
| 671 | if isinstance(search_k, int): |
|
| 672 | continue |
|
| 673 | annoy_search_param = {"index_type": index_type, "search_params": {"search_k": search_k}} |
|
| 674 | search_params.append(annoy_search_param) |
|
| 675 | return search_params |
|
| 676 | ||
| 677 | ||
| 678 | def gen_invalid_index(): |
|
| @@ 727-753 (lines=27) @@ | ||
| 724 | return invalid_vectors |
|
| 725 | ||
| 726 | ||
| 727 | def gen_invaild_search_params(): |
|
| 728 | invalid_search_key = 100 |
|
| 729 | search_params = [] |
|
| 730 | for index_type in all_index_types: |
|
| 731 | if index_type == "FLAT": |
|
| 732 | continue |
|
| 733 | search_params.append({"index_type": index_type, "search_params": {"invalid_key": invalid_search_key}}) |
|
| 734 | if index_type in delete_support(): |
|
| 735 | for nprobe in gen_invalid_params(): |
|
| 736 | ivf_search_params = {"index_type": index_type, "search_params": {"nprobe": nprobe}} |
|
| 737 | search_params.append(ivf_search_params) |
|
| 738 | elif index_type in ["HNSW", "RHNSW_PQ", "RHNSW_SQ"]: |
|
| 739 | for ef in gen_invalid_params(): |
|
| 740 | hnsw_search_param = {"index_type": index_type, "search_params": {"ef": ef}} |
|
| 741 | search_params.append(hnsw_search_param) |
|
| 742 | elif index_type == "NSG": |
|
| 743 | for search_length in gen_invalid_params(): |
|
| 744 | nsg_search_param = {"index_type": index_type, "search_params": {"search_length": search_length}} |
|
| 745 | search_params.append(nsg_search_param) |
|
| 746 | search_params.append({"index_type": index_type, "search_params": {"invalid_key": 100}}) |
|
| 747 | elif index_type == "ANNOY": |
|
| 748 | for search_k in gen_invalid_params(): |
|
| 749 | if isinstance(search_k, int): |
|
| 750 | continue |
|
| 751 | annoy_search_param = {"index_type": index_type, "search_params": {"search_k": search_k}} |
|
| 752 | search_params.append(annoy_search_param) |
|
| 753 | return search_params |
|
| 754 | ||
| 755 | ||
| 756 | def gen_invalid_index(): |
|