Hi Dimitar,

thank you for your answer. I will check the performance of the fulltext search again and give you the test data if it is really slower.

I still have one question about the fulltext query. Can I find a whole word (the result of the regular expression: \bWord\b) with fulltext query?

Many thanks.

An

On Fri, Nov 25, 2011 at 3:31 PM, Dimitar Popov <Dimitar.Popov@uni-konstanz.de> wrote:
Hi An,

Am Freitag, 25. November 2011, 11:30:00 schrieb Truong An Nguyen:
> Hi,
>
> I've two questions about the fulltext search.
>
> 1) I've created fulltext i for my  BaseX doesn't understand ftcontains.
> When I try a CONTAINS query in a 1 Gigabyte Database, using text index is
> slower than without text index. How can I use fulltext index rightly?

You can do several things:

1. Make sure that the full-text index is used, i.e. check the "query info" in
the GUI; it should contain "FTIndexAccess" similar to:

<FTIndexAccess data="factbook">
 <FTWords>
   <Item value="norway" type="xs:string"/>
 </FTWords>
</FTIndexAccess>

2a. If the full-text index is used, please send more details about your query
and data (e.g. what full-text options are used); it would be interesting to
see why the index query is slower.

2b. If the full-text index is NOT used, please check that the full-text
options you use in your query correspond to the options with which the full-
text index is created. For more information check our wiki page [1].

> 2) Does BaseX supports regular expression in the fulltext extension? If
> yes, could you please give me an example.

No, full blown regular expressions are not supported by XQuery Full-Text.
However, wild-cards are supported. For the correspond syntax and examples, you
can check the XQuery Full-Text specification [2].

> Thanks
>
> Cheers,
> An

Greetings,
Dimitar

[1] http://docs.basex.org/wiki/Full-Text
[2] http://www.w3.org/TR/xpath-full-text-10/#ftwildcardoption