Builds and executes the query. Returns a list of search results.
(self, **kwargs)
| 949 | self._spelling_suggestion = results.get("spelling_suggestion", None) |
| 950 | |
| 951 | def run_mlt(self, **kwargs): |
| 952 | """Builds and executes the query. Returns a list of search results.""" |
| 953 | if self._more_like_this is False or self._mlt_instance is None: |
| 954 | raise MoreLikeThisError( |
| 955 | "No instance was provided to determine 'More Like This' results." |
| 956 | ) |
| 957 | |
| 958 | additional_query_string = self.build_query() |
| 959 | search_kwargs = { |
| 960 | "start_offset": self.start_offset, |
| 961 | "result_class": self.result_class, |
| 962 | "models": self.models, |
| 963 | } |
| 964 | |
| 965 | if self.end_offset is not None: |
| 966 | search_kwargs["end_offset"] = self.end_offset - self.start_offset |
| 967 | |
| 968 | results = self.backend.more_like_this( |
| 969 | self._mlt_instance, additional_query_string, **search_kwargs |
| 970 | ) |
| 971 | self._results = results.get("results", []) |
| 972 | self._hit_count = results.get("hits", 0) |
| 973 | |
| 974 | |
| 975 | class SolrEngine(BaseEngine): |
nothing calls this directly
no test coverage detected