Hi Laurens,

> Now that I have the query running it looks like it doesn't do
> what I need it to do. cts:element-attribute-values does
> return a list of hash-ids for paragraphs, but the query
> searches within the entire fragment. So the result is all
> hash-ids in all fragments that match the query instead of the
> hash-ids of the paragraphs that contain $q. I'm not entirely
> sure how to proceed from here.

Just a quick pointer on this one. Be aware that searching is fragment-based. 
That is the reason why it works so fast. The query you pass to cts:search is 
applied to all fragments that cover the result of your searchable Xpath 
expression. Just to prevent mistakes I always recommend my colleagues to use 
something like this:

        cts:search(doc(), cts:element-word-query(xs:QName("paragraph"), 
$query))//paragraph

Instead of:

        cts:search(//paragraph, cts:element-word-query(xs:QName("paragraph"), 
$query))

To find the specific paragraphs that contain matches to your query, you will 
have to use cts:highlight, and then use Xpath to find all paragraphs that 
contain highlighted text..

Kind regards,
Geert


Drs. G.P.H. Josten
Consultant


http://www.daidalos.nl/
Daidalos BV
Source of Innovation
Hoekeindsehof 1-4
2665 JZ Bleiswijk
Tel.: +31 (0) 10 850 1200
Fax: +31 (0) 10 850 1199
http://www.daidalos.nl/
KvK 27164984
De informatie - verzonden in of met dit emailbericht - is afkomstig van 
Daidalos BV en is uitsluitend bestemd voor de geadresseerde. Indien u dit 
bericht onbedoeld hebt ontvangen, verzoeken wij u het te verwijderen. Aan dit 
bericht kunnen geen rechten worden ontleend.



_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to