How can I perform multi tags queries with namespace?

I often use the namespace feature, such as
and so on.
Now I want to create a query that retrieves blocks containing both book and python in namespace text. I have tried {{query (and [[book]] [[python]])}}, but it didn’t work as expected. Can someone provide some guidance?

If I understand your intention, one way could be this advanced query:

  :query [
  :find (pull ?b [*])
    [?b :block/refs ?ref1]
    [?ref1 :block/name ?name1]
    [(clojure.string/includes? ?name1 "book")]
    [?b :block/refs ?ref2]
    [?ref2 :block/name ?name2]
    [(clojure.string/includes? ?name2 "python")]