From: Adam Dickmeiss Date: Wed, 3 Jun 2015 12:11:03 +0000 (+0200) Subject: Set defType=lucene if not already set YAZ-736 X-Git-Tag: v5.14.2~10 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=dcbeb5cadb376882cf4ca64fc5c27d3718208e3a;p=yaz-moved-to-github.git Set defType=lucene if not already set YAZ-736 --- diff --git a/src/solr.c b/src/solr.c index e3b8e26..0db149b 100644 --- a/src/solr.c +++ b/src/solr.c @@ -475,6 +475,7 @@ int yaz_solr_encode_request(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu, char *cp; const char *path_args = 0; int i = 0; + int defType_set = 0; int no_parms = 20; /* safe upper limit of args without extra_args */ Z_SRW_extra_arg *ea; @@ -492,6 +493,8 @@ int yaz_solr_encode_request(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu, for (ea = srw_pdu->extra_args; ea; ea = ea->next) { name[i] = ea->name; + if (!strcmp(ea->name, "defType")) + defType_set = 1; value[i] = ea->value; i++; } @@ -504,7 +507,9 @@ int yaz_solr_encode_request(Z_HTTP_Request *hreq, Z_SRW_PDU *srw_pdu, solr_op = "select"; if (!srw_pdu->u.request->query) return -1; - /* lucene is the default queryType */ + if (!defType_set) + yaz_add_name_value_str(encode, name, value, &i, "defType", + "lucene"); yaz_add_name_value_str(encode, name, value, &i, "q", request->query); if (srw_pdu->u.request->startRecord) {