Re: Extention XPath function
Vadim Gritsenko <[email protected]>
| Newsgroups | gmane.text.xml.xindice.devel |
|---|---|
| Message-ID | <[email protected]> |
Natalia Shilenkova wrote:
> Hi All,
>
> There is a new XPath function available in Xindice.
>
> Function: boolean ftcontains(string)
>
> The ftcontains function returns true if text content of the context
> node matches full text query passed as the argument, otherwise it
> returns false.
Awesome! Couple of questions...
> Text query syntax is the same as Lucene query syntax,
> except it does not use fields (using fields does not cause errors when
> parsing the query, but function will return false).
Will it log this situation? Possibly, a WARNing?
> Example: Query //chapter/title[ftcontains('story')] will return all
> <title> elements that contain word 'story'.
>
> For XPath queries that use ftcontains function Xindice will attempt to
> optimize the query by using LuceneIndexer, if it is available and has
> a suitable pattern. If LuceneIndexer exists for the collection being
> queried, even if there is no suitable pattern,
Does it also log this condition? I'd think at INFO level, say that indexer
available but this particular pattern is missing, so that user can check logs
and correct the situation.
Vadim
> its analyzer will be
> used for query parsing and tokenizing node text content to produce
> consistent results. If LuceneIndexer is not found, default analyzer
> will be used (at this time it is SimpleAnalyzer).
>
> Comments/feedback/suggestions about new functionality are appreciated :)
>
> Regards,
> Natalia