}
#if 1 /* Nick */
opts |= INDEX_SEARCH_SUMMARY_TYPE;
- opt.summary_type = INDEX_SUMMARISE_CAPITALISE;
+ opt.summary_type = INDEX_SUMMARISE_TAG;
#endif
if (!index_search(Index->idx, query, startdoc, len,
result, &results, &total_results, &est, opts, &opt)) {
}
#if 1 /* Nick */
opts |= INDEX_SEARCH_SUMMARY_TYPE;
- opt.summary_type = INDEX_SUMMARISE_CAPITALISE;
+ opt.summary_type = INDEX_SUMMARISE_TAG;
#endif
if (!index_search(idx, query, startdoc, len, result,
&results, &total_results, &est, opts, &opt)) {
/* internal function to finish up extraction of a sentence */
static struct sentence *extract_finish(struct sentence *sent, struct persum *ps,
enum index_summary_type type, int highlight) {
+#if 1 // Nick, do this first
+ /* remove superfluous whitespace from the end of the sentence */
+ while (sent->buf[sent->buflen - 1] == ' ') {
+ sent->buflen--;
+ }
+#endif
+
if (highlight && type == INDEX_SUMMARISE_TAG) {
/* need to close the tag */
if (sent->buflen + str_len("</b>") >= sent->bufsize
&& (space < str_len("</b>"))) {
sent->buflen--;
}
-
- /* end highlighting */
- str_cpy(sent->buf + sent->buflen, "</b>");
- sent->buflen += str_len("</b>");
}
+
+ /* end highlighting */
+ str_cpy(sent->buf + sent->buflen, "</b>");
+ sent->buflen += str_len("</b>");
}
+#if 0 // Nick, don't want to remove markup by mistake, revisit this later
/* trim overly-long sentence term-by-term */
while (sent->buflen > ps->summary_len) {
sent->buflen--;
while (sent->buf[sent->buflen - 1] == ' ') {
sent->buflen--;
}
+#endif
sent->buf[sent->buflen] = '\0';
+ //printf("sent->buf %s\n", sent->buf);
return sent;
}