+static void snippet_check_fields(ZebraHandle zh, WRBUF wrbuf,
+ zebra_snippets *doc,
+ const zebra_snippet_word *doc_w,
+ const char *w_index_type)
+{
+ /* beginning of snippet. See which fields the snippet also
+ occur */
+ const zebra_snippet_word *w;
+ int no = 0;
+ for (w = zebra_snippets_constlist(doc); w; w = w->next)
+ {
+ /* same sequence but other field? */
+ if (w->seqno == doc_w->seqno && w->ord != doc_w->ord)
+ {
+ const char *index_type;
+ const char *db = 0;
+ const char *string_index = 0;
+
+ zebraExplain_lookup_ord(zh->reg->zei, w->ord,
+ &index_type, &db, &string_index);
+ /* only report for same index type */
+ if (!strcmp(w_index_type, index_type))
+ {
+ if (no == 0)
+ wrbuf_printf(wrbuf, " fields=\"%s", string_index);
+ else
+ wrbuf_printf(wrbuf, " %s", string_index);
+ no++;
+ }
+ }
+ }
+ if (no)
+ wrbuf_printf(wrbuf, "\"");
+}
+