mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 02:48:08 +01:00
Add debugging code for examining query strings.
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.
This commit is contained in:
parent
144b2cbc55
commit
526b7144f7
2 changed files with 9 additions and 1 deletions
2
Makefile
2
Makefile
|
@ -19,7 +19,7 @@ MODULES= \
|
|||
all: $(PROGS)
|
||||
|
||||
%.o: %.cc
|
||||
$(CXX) -c $(CXXFLAGS) $(MYCXXFLAGS) $< -o $@
|
||||
$(CXX) -c $(CFLAGS) $(CXXFLAGS) $(MYCXXFLAGS) $< -o $@
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -c $(CFLAGS) $(MYCFLAGS) $< -o $@
|
||||
|
|
8
query.cc
8
query.cc
|
@ -41,6 +41,10 @@ notmuch_query_create (notmuch_database_t *notmuch,
|
|||
{
|
||||
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;
|
||||
|
@ -118,6 +122,10 @@ notmuch_query_search (notmuch_query_t *query)
|
|||
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 ());
|
||||
|
|
Loading…
Reference in a new issue