GFS: look for facets in additionalSearchInfo
[yaz-moved-to-github.git] / src / seshigh.c
index 898af56..d357095 100644 (file)
@@ -2681,7 +2681,9 @@ static Z_APDU *process_searchRequest(association *assoc, request *reqb)
         bsrr->errcode = 0;
         bsrr->errstring = NULL;
         bsrr->search_info = NULL;
-        bsrr->search_input = req->otherInfo;
+        bsrr->search_input = req->additionalSearchInfo;
+        if (!bsrr->search_input)
+            bsrr->search_input = req->otherInfo;
         bsrr->present_number = *req->mediumSetPresentNumber;
 
         if (assoc->server && assoc->server->cql_transform
@@ -3098,7 +3100,6 @@ static Z_APDU *process_scanRequest(association *assoc, request *reqb)
         {
             Z_Entry *e;
             Z_TermInfo *t;
-            Odr_oct *o;
 
             tab[i] = e = (Z_Entry *)odr_malloc(assoc->encode, sizeof(*e));
             if (bsrr->entries[i].occurrences >= 0)
@@ -3125,15 +3126,10 @@ static Z_APDU *process_scanRequest(association *assoc, request *reqb)
                 t->term = (Z_Term *)
                     odr_malloc(assoc->encode, sizeof(*t->term));
                 t->term->which = Z_Term_general;
-                t->term->u.general = o =
-                    (Odr_oct *)odr_malloc(assoc->encode, sizeof(Odr_oct));
-                o->buf = (char *)
-                    odr_malloc(assoc->encode, o->len =
-                               strlen(bsrr->entries[i].term));
-#if OCT_SIZE
-                o->size = o->len;
-#endif
-                memcpy(o->buf, bsrr->entries[i].term, o->len);
+                t->term->u.general =
+                    odr_create_Odr_oct(assoc->encode,
+                                       bsrr->entries[i].term,
+                                       strlen(bsrr->entries[i].term));
                 yaz_log(YLOG_DEBUG, "  term #%d: '%s' (" ODR_INT_PRINTF ")", i,
                          bsrr->entries[i].term, bsrr->entries[i].occurrences);
             }