X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Ftermlists.c;h=79e88ee489fd146f19d6055fac3bf62ce83bee62;hb=d8ce400566fc900c78df81c50cd788c35baa0251;hp=64f397a9487c68273eaf6d137cf9e9e0c1588d9c;hpb=8961ed761e348e972f00d015284ce75c16b1648c;p=pazpar2-moved-to-github.git diff --git a/src/termlists.c b/src/termlists.c index 64f397a..79e88ee 100644 --- a/src/termlists.c +++ b/src/termlists.c @@ -1,5 +1,5 @@ /* This file is part of Pazpar2. - Copyright (C) 2006-2012 Index Data + Copyright (C) Index Data Pazpar2 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -62,7 +62,8 @@ struct termlist *termlist_create(NMEM nmem) } void termlist_insert(struct termlist *tl, const char *display_term, - const char *norm_term, int freq) + const char *norm_term, const char *id, size_t id_len, + int freq) { unsigned int bucket; struct termlist_bucket **p; @@ -87,6 +88,7 @@ void termlist_insert(struct termlist *tl, const char *display_term, new->term.norm_term = nmem_strdup(tl->nmem, buf); new->term.display_term = *display_term ? nmem_strdup(tl->nmem, display_term) : new->term.norm_term; + new->term.id = id ? nmem_strdupn(tl->nmem, id, id_len) : 0; new->term.frequency = freq; new->next = 0; *p = new;