Full text search

What’s involved in setting up full text search on a certain xml schema? How does this translate to XPath/XQuery

Michel

Hi,

do you mean you want to search the whole document content (not content of a single sub-level element)?

You need an index of type “text” on the root element of you schema. Then Tamino builds a text-index for every word in every document you store in this schema.

Then you can do index-supported querying, which would look like this in XQL (say your root element is “chapter”):

_xql=chapter[.~=“Excalibur”]
which means “gimme every chapter that contains (~=) the word Excalibur”.

You can go wild with wildcard ():
_xql=chapter[.~=“calibur"]
_xql=chapter[.~="Excali
”]
_xql=chapter[.~="Ex
bur"]

Index-supported, all of these queries are fast even with thousands of documents. But beware of leading and trailing asterisk in one query, like this:
_xql=chapter[.~=“cali”]

This is called a word fragment search and this is by default not index-supported. If you need index-support for such queries, you should engange “word fragment index” (to be found the database properties section in Tamino Manager). It can be enabled for the whole database only, and it somewhat slows down processing of inserts. But it makes all kinds of word-fragment searches possible.

Best regards, Andreas

Hi,

in addition to Andreas’ remarks: all the queries
he mentions are possible without any index. They are, of course, not that fast as with an index, but for testing purposes with a small database, you do not need text indexes

Regards

Harald

Is this also going to work if my document is in a custom workspace? How do handle this in xql?

Michel

Hi,

are you referring to a collection when writing “workspace”?
Yes, same procedure - you give teh name of the collection in the URL in case of direct http addressing.
Andreas’ queries are xql (X-Query), same is possible in XQuery with tf:containsText

Regards

Harald