Christian and all: I have a similar question. When I execute the following query: declare namespace ddi = "http://www.icpsr.umich.edu/DDI"; let $allvars := /ddi:codeBook/ddi:dataDscr/ddi:var let $vars := $allvars[ddi:labl contains text 'child'] return $vars/ddi:labl my query plan does not seem to take advantage of the full text index (see below). Now I did enable full text search after loading the XML in the DB but performed and optimze and can see the FT active in the properties dialog. Does this make a difference? best *P
Query: declare namespace ddi = "http://www.icpsr.umich.edu/DDI"; Timing: - Parsing: 0.14 ms - Compiling: 0.15 ms - Evaluating: 1450.27 ms - Printing: 24.39 ms - Total Time: 1474.97 ms Result: - Results: 3114 Items - Updated: 0 Items - Printed: 308 KB Query plan: <FLWR> <Let var="$allvars"> <IterPath> <Root/> <IterStep axis="child" test="ddi:codeBook"/> <IterStep axis="child" test="ddi:dataDscr"/> <IterStep axis="child" test="ddi:var"/> </IterPath> </Let> <Let var="$vars"> <IterFilter> <VarRef name="$allvars"/> <FTContains> <AxisPath> <IterStep axis="child" test="ddi:labl"/> </AxisPath> <FTWords> <Item value="child" type="xs:string"/> </FTWords> </FTContains> </IterFilter> </Let> <Return> <AxisPath> <VarRef name="$vars"/> <IterStep axis="child" test="ddi:labl"/> </AxisPath> </Return> </FLWR>
On 11/25/11 1:06 PM, Christian Grün wrote:
Hi An,
- I've created fulltext i for my BaseX doesn't understand ftcontains.
just to avoid any confusion: the W3 XML Query WG has changed the "ftcontains" keyword to "contains text" due to conflicts with the existing specification of element constructors [1]. This is also the reason why 2 keywords are required for all updating expressions.. e.g.: "insert node", "delete node", etc.
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?
This is actually the default behavior of XQuery Full Text, as shown in the following examples:
"a b" contains text "a" → true "ab c" contains text "a" → false
On behalf of Dimitri, Christian
[1] http://www.w3.org/Bugs/Public/show_bug.cgi?id=7247 ___________________________
On Fri, Nov 25, 2011 at 4:45 PM, Truong An Nguyen ngtruongan@gmail.com wrote:
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.
- 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:
- 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].
- 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
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk