From 95ee4e86170d02d0df7d11203edf56aea59d7187 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 6 May 2013 14:56:19 +0200 Subject: [PATCH] Dynamic mergekey PAZ-868 --- doc/pazpar2_protocol.xml | 22 +++- src/http_command.c | 3 +- src/session.c | 70 +++++++--- src/session.h | 4 +- test/test_http.urls | 4 + test/test_http_87.res | 2 + test/test_http_88.res | 318 ++++++++++++++++++++++++++++++++++++++++++++++ test/test_http_89.res | 318 ++++++++++++++++++++++++++++++++++++++++++++++ test/test_http_90.res | 318 ++++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 1038 insertions(+), 21 deletions(-) create mode 100644 test/test_http_87.res create mode 100644 test/test_http_88.res create mode 100644 test/test_http_89.res create mode 100644 test/test_http_90.res diff --git a/doc/pazpar2_protocol.xml b/doc/pazpar2_protocol.xml index 5e806bf..8fb88cf 100644 --- a/doc/pazpar2_protocol.xml +++ b/doc/pazpar2_protocol.xml @@ -418,7 +418,27 @@ search.pz2?session=2044502273&command=stat - + + + mergekey + + + Sets mergekey for this show and rest of session, or until + another mergekey is given for show. The mergekey value is a + comma separated list with one or more names as they appear + in the service description equivalent to + mergekey="optional" inside a metadata element. + If the empty string is given for mergekey it is disabled + and rest of session will use the default mergekey from service + or stylesheet. + + + This facility, "dynamic mergekey", appeared in Pazpar2 version + 1.6.31. + + + + diff --git a/src/http_command.c b/src/http_command.c index cbe09aa..5353e84 100644 --- a/src/http_command.c +++ b/src/http_command.c @@ -1211,6 +1211,7 @@ static void cmd_show(struct http_channel *c) const char *block = http_argbyname(rq, "block"); const char *sort = http_argbyname(rq, "sort"); const char *block_error = http_argbyname(rq, "report"); + const char *mergekey = http_argbyname(rq, "mergekey"); struct conf_service *service = 0; struct reclist_sortparms *sp; @@ -1233,7 +1234,7 @@ static void cmd_show(struct http_channel *c) release_session(c, s); return; } - session_sort(s->psession, sp); + session_sort(s->psession, sp, mergekey); status = session_active_clients(s->psession); diff --git a/src/session.c b/src/session.c index 5ad2694..ed80133 100644 --- a/src/session.c +++ b/src/session.c @@ -644,7 +644,9 @@ static void session_clear_set(struct session *se, struct reclist_sortparms *sp) se->reclist = reclist_create(se->nmem); } -static void session_sort_unlocked(struct session *se, struct reclist_sortparms *sp) +static void session_sort_unlocked(struct session *se, + struct reclist_sortparms *sp, + const char *mergekey) { struct reclist_sortparms *sr; struct client_list *l; @@ -655,20 +657,37 @@ static void session_sort_unlocked(struct session *se, struct reclist_sortparms * session_log(se, YLOG_DEBUG, "session_sort field=%s increasing=%d type=%d", field, increasing, type); - /* see if we already have sorted for this criteria */ - for (sr = se->sorted_results; sr; sr = sr->next) + + if (!mergekey || + (se->mergekey && !strcmp(se->mergekey, mergekey))) { - if (!reclist_sortparms_cmp(sr, sp)) - break; + /* mergekey unchanged.. */ + /* see if we already have sorted for this criteria */ + for (sr = se->sorted_results; sr; sr = sr->next) + { + if (!reclist_sortparms_cmp(sr, sp)) + break; + } + if (sr) + { + session_log(se, YLOG_DEBUG, "search_sort: field=%s increasing=%d type=%d already fetched", + field, increasing, type); + return; + } + session_log(se, YLOG_DEBUG, "search_sort: field=%s increasing=%d type=%d must fetch", + field, increasing, type); } - if (sr) + else { - session_log(se, YLOG_DEBUG, "search_sort: field=%s increasing=%d type=%d already fetched", - field, increasing, type); - return; + /* new mergekey must research/reingest anyway */ + assert(mergekey); + xfree(se->mergekey); + se->mergekey = *mergekey ? xstrdup(mergekey) : 0; + clients_research = 1; + + session_log(se, YLOG_DEBUG, "search_sort: new mergekey = %s", + mergekey); } - session_log(se, YLOG_DEBUG, "search_sort: field=%s increasing=%d type=%d must fetch", - field, increasing, type); // We need to reset reclist on every sort that changes the records, not just for position // So if just one client requires new searching, we need to clear set. @@ -717,9 +736,11 @@ static void session_sort_unlocked(struct session *se, struct reclist_sortparms * } } -void session_sort(struct session *se, struct reclist_sortparms *sp) { +void session_sort(struct session *se, struct reclist_sortparms *sp, + const char *mergekey) +{ //session_enter(se, "session_sort"); - session_sort_unlocked(se, sp); + session_sort_unlocked(se, sp, mergekey); //session_leave(se, "session_sort"); } @@ -925,6 +946,7 @@ void session_destroy(struct session *se) normalize_cache_destroy(se->normalize_cache); relevance_destroy(&se->relevance); reclist_destroy(se->reclist); + xfree(se->mergekey); if (nmem_total(se->nmem)) session_log(se, YLOG_DEBUG, "NMEN operation usage %zd", nmem_total(se->nmem)); if (nmem_total(se->session_nmem)) @@ -973,6 +995,7 @@ struct session *new_session(NMEM nmem, struct conf_service *service, session->databases = 0; session->sorted_results = 0; session->facet_limits = 0; + session->mergekey = 0; for (i = 0; i <= SESSION_WATCH_MAX; i++) { @@ -1501,15 +1524,25 @@ static int get_mergekey_from_doc(xmlDoc *doc, xmlNode *root, const char *name, } static const char *get_mergekey(xmlDoc *doc, struct client *cl, int record_no, - struct conf_service *service, NMEM nmem) + struct conf_service *service, NMEM nmem, + const char *session_mergekey) { char *mergekey_norm = 0; xmlNode *root = xmlDocGetRootElement(doc); WRBUF norm_wr = wrbuf_alloc(); + xmlChar *mergekey; - /* consider mergekey from XSL first */ - xmlChar *mergekey = xmlGetProp(root, (xmlChar *) "mergekey"); - if (mergekey) + if (session_mergekey) + { + int i, num = 0; + char **values = 0; + nmem_strsplit_escape2(nmem, ",", session_mergekey, &values, + &num, 1, '\\', 1); + + for (i = 0; i < num; i++) + get_mergekey_from_doc(doc, root, values[i], service, norm_wr); + } + else if ((mergekey = xmlGetProp(root, (xmlChar *) "mergekey"))) { const char *norm_str; pp2_charset_token_t prt = @@ -1667,7 +1700,8 @@ int ingest_record(struct client *cl, const char *rec, return -2; } - mergekey_norm = get_mergekey(xdoc, cl, record_no, service, nmem); + mergekey_norm = get_mergekey(xdoc, cl, record_no, service, nmem, + se->mergekey); if (!mergekey_norm) { session_log(se, YLOG_WARN, "Got no mergekey"); diff --git a/src/session.h b/src/session.h index 0b05afc..af73f03 100644 --- a/src/session.h +++ b/src/session.h @@ -111,6 +111,7 @@ struct session { struct named_termlist termlists[SESSION_MAX_TERMLISTS]; struct relevance *relevance; struct reclist *reclist; + char *mergekey; struct session_watchentry watchlist[SESSION_WATCH_MAX + 1]; int total_records; int total_merged; @@ -159,7 +160,8 @@ void session_destroy(struct session *s); void session_init_databases(struct session *s); void statistics(struct session *s, struct statistics *stat); -void session_sort(struct session *se, struct reclist_sortparms *sp); +void session_sort(struct session *se, struct reclist_sortparms *sp, + const char *mergekey); enum pazpar2_error_code session_search(struct session *s, const char *query, const char *startrecs, diff --git a/test/test_http.urls b/test/test_http.urls index e51c15e..c641fd0 100644 --- a/test/test_http.urls +++ b/test/test_http.urls @@ -84,3 +84,7 @@ http://localhost:9763/search.pz2?session=10&command=search&query=teachers&limit= http://localhost:9763/search.pz2?session=10&command=show&block=1 http://localhost:9763/search.pz2?session=10&command=record&id=content%3A+title+the+religious+teachers+of+greece+author+adam+james+medium+book&offset=0&esn=F&r=1 http://localhost:9763/search.pz2?session=10&command=record&id=content%3A+title+the+religious+teachers+of+greece+author+adam+james+medium+book&offset=0&esn=F&r=2 +http://localhost:9763/search.pz2?session=10&command=search&query=computer +http://localhost:9763/search.pz2?session=10&command=show&block=1 +http://localhost:9763/search.pz2?session=10&command=show&block=1&mergekey=date +http://localhost:9763/search.pz2?session=10&command=show&block=1&mergekey= diff --git a/test/test_http_87.res b/test/test_http_87.res new file mode 100644 index 0000000..ab63fe6 --- /dev/null +++ b/test/test_http_87.res @@ -0,0 +1,2 @@ + +OK \ No newline at end of file diff --git a/test/test_http_88.res b/test/test_http_88.res new file mode 100644 index 0000000..837a9ff --- /dev/null +++ b/test/test_http_88.res @@ -0,0 +1,318 @@ + +OK +0 +9 +10 +0 +9 + + How to program a computer + Jack Collins + + How to program a computer + Jack Collins + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + + + How to program a computer + Jack Collins + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + + 2 + 48160 + +field=title content=How to program a computer; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(4))); +computer: tf[1] += w[1](6) / length(5) (1.200000); +field=title content=How to program a computer; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(4))); +computer: tf[1] += w[1](6) / length(5) (2.400000); +relevance = 0; +idf[1] = log(((1 + total(10))/termoccur(9)); +computer: relevance += 100000 * tf[1](2.400000) * idf[1](0.200671) (48160); +score = relevance(48160); + + content: title how to program a computer author jack collins medium book + + + Computer science & technology + proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976 + 1977 + Optical pattern recognition + + Computer science & technology + proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976 + 1977 + Optical pattern recognition + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + Optical pattern recognition + PAZPAR2_NULL_b + PAZPAR2_NULL_c + + 1 + 40134 + +field=title content=Computer science &amp; technology :; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(0))); +computer: tf[1] += w[1](6) / length(3) (2.000000); +relevance = 0; +idf[1] = log(((1 + total(10))/termoccur(9)); +computer: relevance += 100000 * tf[1](2.000000) * idf[1](0.200671) (40134); +score = relevance(40134); + + content: title computer science technology author medium book + + + The Computer Bible + 1973-1980 + Bible. O.T + Bible + Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates + + The Computer Bible + 1973-1980 + Bible. O.T + Bible + Hebrew and Greek; introductions in English + Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + + 1 + 40134 + +field=title content=The Computer Bible /; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(1))); +computer: tf[1] += w[1](6) / length(3) (2.000000); +relevance = 0; +idf[1] = log(((1 + total(10))/termoccur(9)); +computer: relevance += 100000 * tf[1](2.000000) * idf[1](0.200671) (40134); +score = relevance(40134); + + content: title the computer bible author medium book + + + A plan for community college computer development + 1971 + Universities and colleges + Community colleges + Cover title + + A plan for community college computer development + 1971 + Universities and colleges + Community colleges + Cover title + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + Universities and colleges + PAZPAR2_NULL_b + PAZPAR2_NULL_c + Community colleges + PAZPAR2_NULL_b + PAZPAR2_NULL_c + + 1 + 17200 + +field=title content=A plan for community college computer development.; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(5))); +computer: tf[1] += w[1](6) / length(7) (0.857143); +relevance = 0; +idf[1] = log(((1 + total(10))/termoccur(9)); +computer: relevance += 100000 * tf[1](0.857143) * idf[1](0.200671) (17200); +score = relevance(17200); + + content: title a plan for community college computer development author medium book + + + Washington metropolitan area rail computer feasibility study; + final report + 1971 + Englund, Carl R + Railroads + "Contract DOT-UT-10003." + + Washington metropolitan area rail computer feasibility study; + final report + 1971 + Englund, Carl R + Railroads + "Contract DOT-UT-10003." + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + Railroads + PAZPAR2_NULL_b + PAZPAR2_NULL_c + + 1 + 17200 + +field=title content=Washington metropolitan area rail computer feasib ...; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(4))); +computer: tf[1] += w[1](6) / length(7) (0.857143); +relevance = 0; +idf[1] = log(((1 + total(10))/termoccur(9)); +computer: relevance += 100000 * tf[1](0.857143) * idf[1](0.200671) (17200); +score = relevance(17200); + + content: title washington metropolitan area rail computer feasibility study author englund carl r medium book + + + The Puget Sound Region + a portfolio of thematic computer maps + 1974 + Mairs, John W + Cartography + Puget Sound region (Wash.) + Scale of maps ca. 1:1,000,000 + + The Puget Sound Region + a portfolio of thematic computer maps + 1974 + Mairs, John W + Cartography + Puget Sound region (Wash.) + Scale of maps ca. 1:1,000,000 + Bibliography: p. 4 + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + Cartography + PAZPAR2_NULL_b + PAZPAR2_NULL_c + + 1 + 16722 + +field=title-remainder content=a portfolio of thematic computer maps /; +computer: w[1] += w(5) / (1+log2(1+lead_decay(0.000000) * length(4))); +computer: tf[1] += w[1](5) / length(6) (0.833333); +relevance = 0; +idf[1] = log(((1 + total(10))/termoccur(9)); +computer: relevance += 100000 * tf[1](0.833333) * idf[1](0.200671) (16722); +score = relevance(16722); + + content: title the puget sound region author mairs john w medium book + + + Computer processing of dynamic images from an Anger scintillation camera + the proceedings of a workshop + 1974 + Radioisotope scanning + Scintillation cameras + Imaging systems in medicine + Includes bibliographical references and index + + Computer processing of dynamic images from an Anger scintillation camera + the proceedings of a workshop + 1974 + Radioisotope scanning + Scintillation cameras + Imaging systems in medicine + Includes bibliographical references and index + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + Radioisotope scanning + PAZPAR2_NULL_b + PAZPAR2_NULL_c + Scintillation cameras + PAZPAR2_NULL_b + PAZPAR2_NULL_c + Imaging systems in medicine + PAZPAR2_NULL_b + PAZPAR2_NULL_c + + 1 + 12040 + +field=title content=Computer processing of dynamic images from an Ang ...; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(0))); +computer: tf[1] += w[1](6) / length(10) (0.600000); +relevance = 0; +idf[1] = log(((1 + total(10))/termoccur(9)); +computer: relevance += 100000 * tf[1](0.600000) * idf[1](0.200671) (12040); +score = relevance(12040); + + content: title computer processing of dynamic images from an anger scintillation camera author medium book + + + The use of passwords for controlled access to computer resources + 1977 + Wood, Helen M + Computers + + The use of passwords for controlled access to computer resources + 1977 + Wood, Helen M + Computers + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + Computers + PAZPAR2_NULL_b + PAZPAR2_NULL_c + + 1 + 12040 + +field=title content=The use of passwords for controlled access to com ...; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(8))); +computer: tf[1] += w[1](6) / length(10) (0.600000); +relevance = 0; +idf[1] = log(((1 + total(10))/termoccur(9)); +computer: relevance += 100000 * tf[1](0.600000) * idf[1](0.200671) (12040); +score = relevance(12040); + + content: title the use of passwords for controlled access to computer resources author wood helen m medium book + + + Reconstruction tomography in diagnostic radiology and nuclear medicine + proceedings of the workshop + 1977 + Tomography + Includes bibliographical references and index + + Reconstruction tomography in diagnostic radiology and nuclear medicine + proceedings of the workshop + 1977 + Tomography + Includes bibliographical references and index + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + Tomography + PAZPAR2_NULL_b + PAZPAR2_NULL_c + + 1 + 0 + +relevance = 0; +idf[1] = log(((1 + total(10))/termoccur(9)); +computer: relevance += 100000 * tf[1](0.000000) * idf[1](0.200671) (0); +score = relevance(0); + + content: title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book + + \ No newline at end of file diff --git a/test/test_http_89.res b/test/test_http_89.res new file mode 100644 index 0000000..837a9ff --- /dev/null +++ b/test/test_http_89.res @@ -0,0 +1,318 @@ + +OK +0 +9 +10 +0 +9 + + How to program a computer + Jack Collins + + How to program a computer + Jack Collins + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + + + How to program a computer + Jack Collins + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + + 2 + 48160 + +field=title content=How to program a computer; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(4))); +computer: tf[1] += w[1](6) / length(5) (1.200000); +field=title content=How to program a computer; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(4))); +computer: tf[1] += w[1](6) / length(5) (2.400000); +relevance = 0; +idf[1] = log(((1 + total(10))/termoccur(9)); +computer: relevance += 100000 * tf[1](2.400000) * idf[1](0.200671) (48160); +score = relevance(48160); + + content: title how to program a computer author jack collins medium book + + + Computer science & technology + proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976 + 1977 + Optical pattern recognition + + Computer science & technology + proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976 + 1977 + Optical pattern recognition + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + Optical pattern recognition + PAZPAR2_NULL_b + PAZPAR2_NULL_c + + 1 + 40134 + +field=title content=Computer science &amp; technology :; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(0))); +computer: tf[1] += w[1](6) / length(3) (2.000000); +relevance = 0; +idf[1] = log(((1 + total(10))/termoccur(9)); +computer: relevance += 100000 * tf[1](2.000000) * idf[1](0.200671) (40134); +score = relevance(40134); + + content: title computer science technology author medium book + + + The Computer Bible + 1973-1980 + Bible. O.T + Bible + Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates + + The Computer Bible + 1973-1980 + Bible. O.T + Bible + Hebrew and Greek; introductions in English + Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + + 1 + 40134 + +field=title content=The Computer Bible /; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(1))); +computer: tf[1] += w[1](6) / length(3) (2.000000); +relevance = 0; +idf[1] = log(((1 + total(10))/termoccur(9)); +computer: relevance += 100000 * tf[1](2.000000) * idf[1](0.200671) (40134); +score = relevance(40134); + + content: title the computer bible author medium book + + + A plan for community college computer development + 1971 + Universities and colleges + Community colleges + Cover title + + A plan for community college computer development + 1971 + Universities and colleges + Community colleges + Cover title + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + Universities and colleges + PAZPAR2_NULL_b + PAZPAR2_NULL_c + Community colleges + PAZPAR2_NULL_b + PAZPAR2_NULL_c + + 1 + 17200 + +field=title content=A plan for community college computer development.; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(5))); +computer: tf[1] += w[1](6) / length(7) (0.857143); +relevance = 0; +idf[1] = log(((1 + total(10))/termoccur(9)); +computer: relevance += 100000 * tf[1](0.857143) * idf[1](0.200671) (17200); +score = relevance(17200); + + content: title a plan for community college computer development author medium book + + + Washington metropolitan area rail computer feasibility study; + final report + 1971 + Englund, Carl R + Railroads + "Contract DOT-UT-10003." + + Washington metropolitan area rail computer feasibility study; + final report + 1971 + Englund, Carl R + Railroads + "Contract DOT-UT-10003." + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + Railroads + PAZPAR2_NULL_b + PAZPAR2_NULL_c + + 1 + 17200 + +field=title content=Washington metropolitan area rail computer feasib ...; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(4))); +computer: tf[1] += w[1](6) / length(7) (0.857143); +relevance = 0; +idf[1] = log(((1 + total(10))/termoccur(9)); +computer: relevance += 100000 * tf[1](0.857143) * idf[1](0.200671) (17200); +score = relevance(17200); + + content: title washington metropolitan area rail computer feasibility study author englund carl r medium book + + + The Puget Sound Region + a portfolio of thematic computer maps + 1974 + Mairs, John W + Cartography + Puget Sound region (Wash.) + Scale of maps ca. 1:1,000,000 + + The Puget Sound Region + a portfolio of thematic computer maps + 1974 + Mairs, John W + Cartography + Puget Sound region (Wash.) + Scale of maps ca. 1:1,000,000 + Bibliography: p. 4 + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + Cartography + PAZPAR2_NULL_b + PAZPAR2_NULL_c + + 1 + 16722 + +field=title-remainder content=a portfolio of thematic computer maps /; +computer: w[1] += w(5) / (1+log2(1+lead_decay(0.000000) * length(4))); +computer: tf[1] += w[1](5) / length(6) (0.833333); +relevance = 0; +idf[1] = log(((1 + total(10))/termoccur(9)); +computer: relevance += 100000 * tf[1](0.833333) * idf[1](0.200671) (16722); +score = relevance(16722); + + content: title the puget sound region author mairs john w medium book + + + Computer processing of dynamic images from an Anger scintillation camera + the proceedings of a workshop + 1974 + Radioisotope scanning + Scintillation cameras + Imaging systems in medicine + Includes bibliographical references and index + + Computer processing of dynamic images from an Anger scintillation camera + the proceedings of a workshop + 1974 + Radioisotope scanning + Scintillation cameras + Imaging systems in medicine + Includes bibliographical references and index + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + Radioisotope scanning + PAZPAR2_NULL_b + PAZPAR2_NULL_c + Scintillation cameras + PAZPAR2_NULL_b + PAZPAR2_NULL_c + Imaging systems in medicine + PAZPAR2_NULL_b + PAZPAR2_NULL_c + + 1 + 12040 + +field=title content=Computer processing of dynamic images from an Ang ...; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(0))); +computer: tf[1] += w[1](6) / length(10) (0.600000); +relevance = 0; +idf[1] = log(((1 + total(10))/termoccur(9)); +computer: relevance += 100000 * tf[1](0.600000) * idf[1](0.200671) (12040); +score = relevance(12040); + + content: title computer processing of dynamic images from an anger scintillation camera author medium book + + + The use of passwords for controlled access to computer resources + 1977 + Wood, Helen M + Computers + + The use of passwords for controlled access to computer resources + 1977 + Wood, Helen M + Computers + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + Computers + PAZPAR2_NULL_b + PAZPAR2_NULL_c + + 1 + 12040 + +field=title content=The use of passwords for controlled access to com ...; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(8))); +computer: tf[1] += w[1](6) / length(10) (0.600000); +relevance = 0; +idf[1] = log(((1 + total(10))/termoccur(9)); +computer: relevance += 100000 * tf[1](0.600000) * idf[1](0.200671) (12040); +score = relevance(12040); + + content: title the use of passwords for controlled access to computer resources author wood helen m medium book + + + Reconstruction tomography in diagnostic radiology and nuclear medicine + proceedings of the workshop + 1977 + Tomography + Includes bibliographical references and index + + Reconstruction tomography in diagnostic radiology and nuclear medicine + proceedings of the workshop + 1977 + Tomography + Includes bibliographical references and index + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + Tomography + PAZPAR2_NULL_b + PAZPAR2_NULL_c + + 1 + 0 + +relevance = 0; +idf[1] = log(((1 + total(10))/termoccur(9)); +computer: relevance += 100000 * tf[1](0.000000) * idf[1](0.200671) (0); +score = relevance(0); + + content: title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book + + \ No newline at end of file diff --git a/test/test_http_90.res b/test/test_http_90.res new file mode 100644 index 0000000..eee953c --- /dev/null +++ b/test/test_http_90.res @@ -0,0 +1,318 @@ + +OK +0 +9 +10 +0 +9 + + How to program a computer + Jack Collins + + How to program a computer + Jack Collins + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + + + How to program a computer + Jack Collins + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + + 2 + 24427 + +field=title content=How to program a computer; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(4))); +computer: tf[1] += w[1](6) / length(5) (1.200000); +field=title content=How to program a computer; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(4))); +computer: tf[1] += w[1](6) / length(5) (2.400000); +relevance = 0; +idf[1] = log(((1 + total(30))/termoccur(28)); +computer: relevance += 100000 * tf[1](2.400000) * idf[1](0.101783) (24427); +score = relevance(24427); + + content: title how to program a computer author jack collins medium book + + + Computer science & technology + proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976 + 1977 + Optical pattern recognition + + Computer science & technology + proceedings of a workshop held at the National Bureau of Standards, Gaithersburg, MD, June 3-4, 1976 + 1977 + Optical pattern recognition + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + Optical pattern recognition + PAZPAR2_NULL_b + PAZPAR2_NULL_c + + 1 + 20356 + +field=title content=Computer science &amp; technology :; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(0))); +computer: tf[1] += w[1](6) / length(3) (2.000000); +relevance = 0; +idf[1] = log(((1 + total(30))/termoccur(28)); +computer: relevance += 100000 * tf[1](2.000000) * idf[1](0.101783) (20356); +score = relevance(20356); + + content: title computer science technology author medium book + + + The Computer Bible + 1973-1980 + Bible. O.T + Bible + Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates + + The Computer Bible + 1973-1980 + Bible. O.T + Bible + Hebrew and Greek; introductions in English + Vols. 2, 8: Missoula, Mont. : Published by Scholars Press for Biblical Research Associates + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + + 1 + 20356 + +field=title content=The Computer Bible /; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(1))); +computer: tf[1] += w[1](6) / length(3) (2.000000); +relevance = 0; +idf[1] = log(((1 + total(30))/termoccur(28)); +computer: relevance += 100000 * tf[1](2.000000) * idf[1](0.101783) (20356); +score = relevance(20356); + + content: title the computer bible author medium book + + + A plan for community college computer development + 1971 + Universities and colleges + Community colleges + Cover title + + A plan for community college computer development + 1971 + Universities and colleges + Community colleges + Cover title + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + Universities and colleges + PAZPAR2_NULL_b + PAZPAR2_NULL_c + Community colleges + PAZPAR2_NULL_b + PAZPAR2_NULL_c + + 1 + 8724 + +field=title content=A plan for community college computer development.; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(5))); +computer: tf[1] += w[1](6) / length(7) (0.857143); +relevance = 0; +idf[1] = log(((1 + total(30))/termoccur(28)); +computer: relevance += 100000 * tf[1](0.857143) * idf[1](0.101783) (8724); +score = relevance(8724); + + content: title a plan for community college computer development author medium book + + + Washington metropolitan area rail computer feasibility study; + final report + 1971 + Englund, Carl R + Railroads + "Contract DOT-UT-10003." + + Washington metropolitan area rail computer feasibility study; + final report + 1971 + Englund, Carl R + Railroads + "Contract DOT-UT-10003." + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + Railroads + PAZPAR2_NULL_b + PAZPAR2_NULL_c + + 1 + 8724 + +field=title content=Washington metropolitan area rail computer feasib ...; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(4))); +computer: tf[1] += w[1](6) / length(7) (0.857143); +relevance = 0; +idf[1] = log(((1 + total(30))/termoccur(28)); +computer: relevance += 100000 * tf[1](0.857143) * idf[1](0.101783) (8724); +score = relevance(8724); + + content: title washington metropolitan area rail computer feasibility study author englund carl r medium book + + + The Puget Sound Region + a portfolio of thematic computer maps + 1974 + Mairs, John W + Cartography + Puget Sound region (Wash.) + Scale of maps ca. 1:1,000,000 + + The Puget Sound Region + a portfolio of thematic computer maps + 1974 + Mairs, John W + Cartography + Puget Sound region (Wash.) + Scale of maps ca. 1:1,000,000 + Bibliography: p. 4 + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + Cartography + PAZPAR2_NULL_b + PAZPAR2_NULL_c + + 1 + 8481 + +field=title-remainder content=a portfolio of thematic computer maps /; +computer: w[1] += w(5) / (1+log2(1+lead_decay(0.000000) * length(4))); +computer: tf[1] += w[1](5) / length(6) (0.833333); +relevance = 0; +idf[1] = log(((1 + total(30))/termoccur(28)); +computer: relevance += 100000 * tf[1](0.833333) * idf[1](0.101783) (8481); +score = relevance(8481); + + content: title the puget sound region author mairs john w medium book + + + Computer processing of dynamic images from an Anger scintillation camera + the proceedings of a workshop + 1974 + Radioisotope scanning + Scintillation cameras + Imaging systems in medicine + Includes bibliographical references and index + + Computer processing of dynamic images from an Anger scintillation camera + the proceedings of a workshop + 1974 + Radioisotope scanning + Scintillation cameras + Imaging systems in medicine + Includes bibliographical references and index + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + Radioisotope scanning + PAZPAR2_NULL_b + PAZPAR2_NULL_c + Scintillation cameras + PAZPAR2_NULL_b + PAZPAR2_NULL_c + Imaging systems in medicine + PAZPAR2_NULL_b + PAZPAR2_NULL_c + + 1 + 6106 + +field=title content=Computer processing of dynamic images from an Ang ...; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(0))); +computer: tf[1] += w[1](6) / length(10) (0.600000); +relevance = 0; +idf[1] = log(((1 + total(30))/termoccur(28)); +computer: relevance += 100000 * tf[1](0.600000) * idf[1](0.101783) (6106); +score = relevance(6106); + + content: title computer processing of dynamic images from an anger scintillation camera author medium book + + + The use of passwords for controlled access to computer resources + 1977 + Wood, Helen M + Computers + + The use of passwords for controlled access to computer resources + 1977 + Wood, Helen M + Computers + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + Computers + PAZPAR2_NULL_b + PAZPAR2_NULL_c + + 1 + 6106 + +field=title content=The use of passwords for controlled access to com ...; +computer: w[1] += w(6) / (1+log2(1+lead_decay(0.000000) * length(8))); +computer: tf[1] += w[1](6) / length(10) (0.600000); +relevance = 0; +idf[1] = log(((1 + total(30))/termoccur(28)); +computer: relevance += 100000 * tf[1](0.600000) * idf[1](0.101783) (6106); +score = relevance(6106); + + content: title the use of passwords for controlled access to computer resources author wood helen m medium book + + + Reconstruction tomography in diagnostic radiology and nuclear medicine + proceedings of the workshop + 1977 + Tomography + Includes bibliographical references and index + + Reconstruction tomography in diagnostic radiology and nuclear medicine + proceedings of the workshop + 1977 + Tomography + Includes bibliographical references and index + XXXXXXXXXX + test-usersetting-2 data: + YYYYYYYYY + Tomography + PAZPAR2_NULL_b + PAZPAR2_NULL_c + + 1 + 0 + +relevance = 0; +idf[1] = log(((1 + total(30))/termoccur(28)); +computer: relevance += 100000 * tf[1](0.000000) * idf[1](0.101783) (0); +score = relevance(0); + + content: title reconstruction tomography in diagnostic radiology and nuclear medicine author medium book + + \ No newline at end of file -- 1.7.10.4