Search the bSDD database using free text, get list of Classes and/or Properties matching the text. Pagination options are for Classes and Properties combined. So if result consists of 10 classes and 5 properties, TotalCount will be 15. Classes will be listed first, s
(
self,
search_text: str,
type_filter="All",
dictionary_uris=None,
version: int = 1,
offset: int = 0,
limit: int = 100,
)
| 857 | return self.get(endpoint, params) |
| 858 | |
| 859 | def search_text( |
| 860 | self, |
| 861 | search_text: str, |
| 862 | type_filter="All", |
| 863 | dictionary_uris=None, |
| 864 | version: int = 1, |
| 865 | offset: int = 0, |
| 866 | limit: int = 100, |
| 867 | ) -> TextSearchResponseContractV1: |
| 868 | """ |
| 869 | Search the bSDD database using free text, get list of Classes and/or Properties matching the text. |
| 870 | Pagination options are for Classes and Properties combined. |
| 871 | So if result consists of 10 classes and 5 properties, TotalCount will be 15. |
| 872 | Classes will be listed first, so if you then use Offset=10 and Limit=5, you will get the 5 properties. |
| 873 | """ |
| 874 | |
| 875 | if len(search_text) < 2: |
| 876 | raise ValueError("Search text must be at least 2 characters long.") |
| 877 | |
| 878 | if dictionary_uris is None: |
| 879 | dictionary_uris = [] |
| 880 | endpoint = f"TextSearch/v{version}" |
| 881 | params = { |
| 882 | "SearchText": search_text, |
| 883 | "TypeFilter": type_filter, |
| 884 | "DictionaryUris": dictionary_uris, |
| 885 | "offset": offset, |
| 886 | "limit": limit, |
| 887 | } |
| 888 | return self.get(endpoint, params) |
| 889 | |
| 890 | def search_in_dictionary( |
| 891 | self, |