return 0;
}
+const char *client_get_query(struct client *cl, const char **type, NMEM nmem)
+{
+ if (cl->pquery)
+ {
+ *type = "pqf";
+ return nmem_strdup(nmem, cl->pquery);
+ }
+ if (cl->cqlquery)
+ {
+ *type = "cql";
+ return nmem_strdup(nmem, cl->cqlquery);
+ }
+ *type = 0;
+ return 0;
+}
+
int client_start_search(struct client *cl)
{
struct session_database *sdb = client_get_database(cl);
void client_store_xdoc(struct client *cl, int record_no, xmlDoc *xdoc);
+const char *client_get_query(struct client *cl, const char **type, NMEM nmem);
+
#endif
/*
wrbuf_puts(c->wrbuf, ht[i].suggestions_xml);
wrbuf_puts(c->wrbuf, "</suggestions>");
}
+ if (ht[i].query_data)
+ {
+ wrbuf_puts(c->wrbuf, "<query_type>");
+ wrbuf_xmlputs(c->wrbuf, ht[i].query_type);
+ wrbuf_puts(c->wrbuf, "</query_type>\n");
+ wrbuf_puts(c->wrbuf, "<query_data>");
+ wrbuf_xmlputs(c->wrbuf, ht[i].query_data);
+ wrbuf_puts(c->wrbuf, "</query_data>\n");
+ }
wrbuf_puts(c->wrbuf, "</target>");
}
response_close(c, "bytarget");
wrbuf_rewind(w);
res[*count].suggestions_xml =
nmem_strdup(nmem, client_get_suggestions_xml(cl, w));
+
+ res[*count].query_data =
+ client_get_query(cl, &res[*count].query_type, nmem);
wrbuf_destroy(w);
(*count)++;
}
int connected;
char *settings_xml;
char *suggestions_xml;
+ const char *query_type;
+ const char *query_data;
};
struct hitsbytarget *get_hitsbytarget(struct session *s, int *count, NMEM nmem);
<records>2</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>@and 4 computer </query_data>
</target></bytarget>
\ No newline at end of file
<records>2</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>@and 6 computer </query_data>
</target></bytarget>
\ No newline at end of file
<records>7</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>@and 7 computer </query_data>
</target></bytarget>
\ No newline at end of file
<records>0</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>"kubiak stsław" </query_data>
</target></bytarget>
\ No newline at end of file
<records>1</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>@and @attr 1=1003 @attr 6=3 @or "adam, james" other_author @or @attr 1=1016 greece 2015</query_data>
</target></bytarget>
\ No newline at end of file
<records>1</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>@and @attr 1=1003 @attr 6=3 @or "adam, james" other_author @or @attr 1=1016 greece 2015</query_data>
</target></bytarget>
\ No newline at end of file
<records>10</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>@or @attr 1=1016 computer 2015</query_data>
</target>
<target><id>Target-2</id>
<name>LOC-SOLR</name>
<records>100</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>@attr 4=Dal @attr 1=text computer </query_data>
</target></bytarget>
\ No newline at end of file
<records>10</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>@or @attr 1=1016 computer 2015</query_data>
</target>
<target><id>Target-2</id>
<name>LOC-SOLR</name>
<records>100</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>@attr 4=Dal @attr 1=text computer </query_data>
</target></bytarget>
\ No newline at end of file
<records>1</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>@and @attr 1=1003 @attr 6=3 @or "adam, james" other_author @or @attr 1=1016 greece 2015</query_data>
</target></bytarget>
\ No newline at end of file
<records>1</records>
<filtered>2</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>@and @or @and @attr 2=4 @attr 1=30 1976 @attr 2=2 @attr 1=30 1978 @attr 2=3 @attr 1=30 "date=\"foo#?" @or @attr 1=1016 computer 2015</query_data>
</target></bytarget>
\ No newline at end of file
<records>10</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>@or @attr 1=1016 computer 2015</query_data>
</target></bytarget>
\ No newline at end of file
-connect.indexdata.com:9000/mit_opencourseware has preferred status: 1
-connect.indexdata.com:9000/mit_opencourseware has preferred status: 1
-connect.indexdata.com:9000/mit_opencourseware has preferred status: 1
+++ /dev/null
-#!/bin/sh
-
-TEST=`basename $0 .sh`
-# srcdir might be set by make
-srcdir=${srcdir:-"."}
-
-#TODO set up solr target. For now use donut
-
-${srcdir}/run_pazpar2.sh $TEST
-E=$?
-
-grep "has preferred" ${TEST}pazpar2.log | cut -f 4- -d ' ' > test_preferred.log
-
-if [ -f test_preferred.res ] ; then
- diff test_preferred.res test_preferred.log > test_preferred.dif
- E2=$?
- if [ $E2 -ne 0 ] ; then
- echo "has preferred test failed!"
- E=$E2
- fi
-else
- echo "Making test_preferred.res for first time."
- mv test_preferred.log test_preferred.res
-fi
-
-exit $E
-
-# Local Variables:
-# mode:shell-script
-# sh-indentation: 2
-# sh-basic-offset: 4
-# End:
<target><id>connect.indexdata.com:9000/mit_opencourseware</id>
<name>MIT OpenCourseWare</name>
<hits>0</hits>
-<diagnostic>114</diagnostic>
-<addinfo>(backend=localhost:9003)</addinfo>
+<diagnostic>2</diagnostic>
+<message>Temporary system error</message>
+<addinfo>Error: Value 'No query was entered' does not match regexp /.+\bdid not match any.+/ (backend=localhost:9003)</addinfo>
<records>0</records>
+<filtered>0</filtered>
<state>Client_Error</state>
+<query_type>pqf</query_type>
+<query_data>@attr 1=21 computer </query_data>
</target>
<target><id>ocs-loc.indexdata.com/solr/select</id>
<name>LOC (SOLR)</name>
<hits>0</hits>
-<diagnostic>503</diagnostic>
-<addinfo></addinfo>
+<diagnostic>0</diagnostic>
<records>0</records>
-<state>Client_Error</state>
+<filtered>0</filtered>
+<state>Client_Disconnected</state>
+<query_type>pqf</query_type>
+<query_data>@attr 1=subject computer </query_data>
</target></bytarget>
\ No newline at end of file
<target><id>connect.indexdata.com:9000/mit_opencourseware</id>
<name>MIT OpenCourseWare</name>
<hits>0</hits>
-<diagnostic>114</diagnostic>
-<addinfo>(backend=localhost:9003)</addinfo>
+<diagnostic>2</diagnostic>
+<message>Temporary system error</message>
+<addinfo>Error: Value 'No query was entered' does not match regexp /.+\bdid not match any.+/ (backend=localhost:9003)</addinfo>
<records>0</records>
+<filtered>0</filtered>
<state>Client_Error</state>
+<query_type>pqf</query_type>
+<query_data>@attr 1=21 computer </query_data>
</target>
<target><id>ocs-loc.indexdata.com/solr/select</id>
<name>LOC (SOLR)</name>
<hits>0</hits>
-<diagnostic>503</diagnostic>
-<addinfo></addinfo>
+<diagnostic>0</diagnostic>
<records>0</records>
-<state>Client_Error</state>
+<filtered>0</filtered>
+<state>Client_Working</state>
+<query_type>pqf</query_type>
+<query_data>@attr 1=subject computer </query_data>
</target>
<target><id>ocs-oaister.indexdata.com/solr</id>
<name>Oaister (SOLR)</name>
<hits>0</hits>
-<diagnostic>503</diagnostic>
-<addinfo></addinfo>
+<diagnostic>0</diagnostic>
<records>0</records>
-<state>Client_Error</state>
+<filtered>0</filtered>
+<state>Client_Working</state>
+<query_type>pqf</query_type>
+<query_data>@attr 1=subject computer </query_data>
</target></bytarget>
\ No newline at end of file
<target><id>connect.indexdata.com:9000/mit_opencourseware</id>
<name>MIT OpenCourseWare</name>
<hits>0</hits>
-<diagnostic>114</diagnostic>
-<addinfo>(backend=localhost:9003)</addinfo>
+<diagnostic>2</diagnostic>
+<message>Temporary system error</message>
+<addinfo>Error: Value 'No query was entered' does not match regexp /.+\bdid not match any.+/ (backend=localhost:9003)</addinfo>
<records>0</records>
+<filtered>0</filtered>
<state>Client_Error</state>
+<query_type>pqf</query_type>
+<query_data>@attr 1=21 computer </query_data>
</target></bytarget>
\ No newline at end of file
<set name="pz:name" value="Target name"/>
<set name="category" value="1"/>
</settings>
+<query_type>pqf</query_type>
+<query_data>@attr 1=host_wildcard water </query_data>
</target></bytarget>
\ No newline at end of file
<set name="pz:id" value="z3950.indexdata.com/marc"/>
<set name="pz:name" value="1"/>
</settings>
+<query_type>pqf</query_type>
+<query_data>@attr 1=1016 water </query_data>
</target></bytarget>
\ No newline at end of file
<records>100</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>@attr 4=Dal @attr 1=text water </query_data>
</target></bytarget>
\ No newline at end of file
<records>200</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>@attr 4=Dal @attr 1=text water </query_data>
</target></bytarget>
\ No newline at end of file
<records>100</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>@attr 4=Dal @attr 1=text water </query_data>
</target></bytarget>
\ No newline at end of file
<records>100</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>@attr 4=Dal @attr 1=text water </query_data>
</target></bytarget>
\ No newline at end of file
<records>200</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>@attr 4=Dal @attr 1=text water </query_data>
</target></bytarget>
\ No newline at end of file
<records>23</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>computer </query_data>
</target>
<target><id>id_solr</id>
<name>LOC (SOLR)</name>
<records>100</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>@attr 4=Dal @attr 1=text computer </query_data>
</target></bytarget>
\ No newline at end of file
<records>23</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>computer </query_data>
</target>
<target><id>id_solr</id>
<name>LOC (SOLR)</name>
<records>100</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>@attr 4=Dal @attr 1=text computer </query_data>
</target></bytarget>
\ No newline at end of file
<records>23</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>computer </query_data>
</target></bytarget>
\ No newline at end of file
<records>3</records>
<filtered>0</filtered>
<state>Client_Idle</state>
+<query_type>pqf</query_type>
+<query_data>computer </query_data>
</target></bytarget>
\ No newline at end of file