It's nice that Xapian provides a little function to print a textual
representation of the entire query tree. So now, if you compile
like so:
make CFLAGS=-DDEBUG_QUERY
then you get a nice output of the query string received by the query
module, and the final query actually being sent to Xapian.
all: $(PROGS)
%.o: %.cc
- $(CXX) -c $(CXXFLAGS) $(MYCXXFLAGS) $< -o $@
+ $(CXX) -c $(CFLAGS) $(CXXFLAGS) $(MYCXXFLAGS) $< -o $@
%.o: %.c
$(CC) -c $(CFLAGS) $(MYCFLAGS) $< -o $@
{
notmuch_query_t *query;
+#ifdef DEBUG_QUERY
+ fprintf (stderr, "Query string is:\n%s\n", query_string);
+#endif
+
query = talloc (NULL, notmuch_query_t);
if (unlikely (query == NULL))
return NULL;
break;
}
+#if DEBUG_QUERY
+ fprintf (stderr, "Final query is:\n%s\n", final_query.get_description().c_str());
+#endif
+
enquire.set_query (final_query);
mset = enquire.get_mset (0, notmuch->xapian_db->get_doccount ());