Hej Sander,
Indeed the syntax you find now on our documentation page is for a newer
version, then the one you are using. To work with that syntax, you would
need to check-out the development brunch from the pathfinder CVS
repository on sourgeforge.net.
The release version of pf/tijah did not have its own namespace for
search functions. So, you were right to replace
tijah:
by
pf:tijah-
in all search function calls.
If you want to perform full-text queries, you would first have to create
a full-text index. Unfortunately, with the release version you are
using, this can only be done on MIL level, not within XQuery. (I will
attach a mil script for creating an index as an example)
Furthermore, if you want to specify a certain ft-index (earlier also
named collection) to be used for the full-text query, you need to
specify this, in a <TijahOptions collection="name"/> node, and give this
node as the first parameter to your query:
let $opt := <TijahOptions collection="name"/>
return pf:tijah-query($opt, (), "nexi query string")
And one last remark, you cannot perform attribute selections in the NEXI
query string. NEXI does not work with attributes at all.
best -Henning
Sander Bockting wrote:
> Dear all,
>
> We are trying to do a full text search in a database, but we can use some help
> to get started. A small excerpt from our database is stated below:
>
> //===
> xquery>doc("ep")
>
> <?xml version="1.0" encoding="utf-8"?>
> <eprintsdata xmlns="http://eprints.org/ep2/data">
> <record>
> <field name="eprintid">629</field>
> <field name="keywords">Model-based on-the-fly Testing, Timed Automata,
> Real-Time Testing, TorX, Tools.</field>
> <field name="research_projects">STRESS: Systematic Testing of Real-time
> Software Systems</field>
> </record>
>
> <record>
> <field name="eprintid">642</field>
> <field name="keywords">Compositional modelling, supervisory
> control</field>
> <field name="research_projects">HYBRIDGE: Distributed Control and
> Stochastic
> Analysis of Hybrid Systems Supporting Safety Critical Real-Time Systems
> Design</field>
> </record>
> </eprintsdata>
> //===
>
> The PF/Tijah Getting Started page
> (http://dbappl.cs.utwente.nl/pftijah/Documentation/GettingStarted) mentions we
> can do a full text query as follows:
>
> let $c := collection("MyCollection")
> for $res in tijah:query($c, "//html[about(., ir db)]")
> return $res/head/title
>
> I believe this way is probably outdated, as tijah:query does not work. To suit
> our needs, I changed the query to the following form:
>
> //===
> let $c := collection("ep")
> for $res in pf:tijah-query($c,"//[EMAIL
> PROTECTED]'research_projects'][about(.,
> Distributed)]")
> return $res
> //===
>
> But this results in the following error: "ERROR = !ERROR: interpret: unknown
> variable 'collName'" That is why I incorporated the collection name in the
> query, like this:
>
> //===
> for $res in pf:tijah-query(ep,"//[EMAIL
> PROTECTED]'research_projects'][about(.,
> Distributed)]")
> return $res
> //===
>
> However, this also does not work, as I get the following error: "ERROR =
> !illegal reference to context node: at (1,29-1,30): ``.'' is unbound"
>
> I have tried numerous of other variations, but neither of them work. Can
> somebody please help us with an explanation about how we can do a full text
> search within a certain node or point us at a more recent getting started page
> (if it already exists)?
>
> Kind regards,
>
> Sander Bockting
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> MonetDB-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/monetdb-users
module(pftijah);
module(ascii_io);
var coll_param := new(str,str);
coll_param.insert("stemmer","snowball-english");
#coll_param.insert("tagFilter","HEADLINE,TEXT");
coll_param.insert("pf_collection","col");
#coll_param.insert("tokenizer","fast");
#coll_param.insert("fragmentSize","1000");
tj_init_collection("col",coll_param);
var corpus_path := "/local/rodeh/aquaint/xml_aggr/";
var names := new(void, str).seqbase([EMAIL PROTECTED]);
names.append("corpus");
var seps := new(void, str).seqbase([EMAIL PROTECTED]);
seps.append("\n");
var types := new(void, str).seqbase([EMAIL PROTECTED]);
types.append("str");
var filename := corpus_path + "corpus.lst";
filename.print();
var tmp := load(names, seps, types, filename, -1);
var corpus := tmp.find("corpus").seqbase([EMAIL PROTECTED]);
var url_corpus := [+](const corpus_path, corpus);
var docs := url_corpus.reverse().join(corpus);
tj_add2collection("col",docs,true);
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
MonetDB-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-users