MCPcopy Create free account
hub / github.com/django-haystack/django-haystack / build_query

Method build_query

haystack/backends/__init__.py:727–746  ·  view source on GitHub ↗

Interprets the collected query metadata and builds the final query to be sent to the backend.

(self)

Source from the content-addressed store, hash-verified

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:

Callers 7

__str__Method · 0.95
runMethod · 0.95
run_mltMethod · 0.95
runMethod · 0.45
run_mltMethod · 0.45
runMethod · 0.45
run_mltMethod · 0.45

Calls 3

matching_all_fragmentMethod · 0.95
boost_fragmentMethod · 0.95
as_query_stringMethod · 0.80

Tested by

no test coverage detected