Interprets the collected query metadata and builds the final query to be sent to the backend.
(self)
| 725 | return "*" |
| 726 | |
| 727 | def build_query(self): |
| 728 | """ |
| 729 | Interprets the collected query metadata and builds the final query to |
| 730 | be sent to the backend. |
| 731 | """ |
| 732 | final_query = self.query_filter.as_query_string(self.build_query_fragment) |
| 733 | |
| 734 | if not final_query: |
| 735 | # Match all. |
| 736 | final_query = self.matching_all_fragment() |
| 737 | |
| 738 | if self.boost: |
| 739 | boost_list = [] |
| 740 | |
| 741 | for boost_word, boost_value in self.boost.items(): |
| 742 | boost_list.append(self.boost_fragment(boost_word, boost_value)) |
| 743 | |
| 744 | final_query = "%s %s" % (final_query, " ".join(boost_list)) |
| 745 | |
| 746 | return final_query |
| 747 | |
| 748 | def combine(self, rhs, connector=SQ.AND): |
| 749 | if connector == SQ.AND: |