[MarkLogic Dev General] search:search() - why only 1 search match per XML doc
wthompson at jonesmcclure.com
Fri Mar 23 09:37:59 PDT 2012
Without more details I'm not sure what you're trying to do exactly, but it sounds like you may need to write your own snippet module.
From: general-bounces at developer.marklogic.com [mailto:general-bounces at developer.marklogic.com] On Behalf Of Danny Sinang
Sent: Friday, March 23, 2012 8:22 AM
Subject: [MarkLogic Dev General] search:search() - why only 1 search match per XML doc
Am trying to search for the word 'populations' in an XML doc which mentions that word around 5 times in its htmlBody element.
search:search() returns only the first occurrence of that word in that element.
Is there an option or way to make search:search return matches for the other occurrences of population ?
Note that the contents of the htmlBody element (shown below) is a string.
<h5>Control of Bacterial Populations</h5>
<p class="Indent00" id="xpp-2014582732321794086-1">The diseases and many kinds of environmental problems caused by bacteria are actually population control problems. Small numbers of bacteria cause little harm. However, when the population increases, their negative effects are multiplied. Despite large investments of time and money, scientists have found it difficult to control bacterial populations. Three factors operate in favor of the bacteria: their reproductive rate, their ability to form resistant stages, and their ability to mutate and produce strains that resist antibiotics and other control agents.</p>
<p class="Indent01" id="xpp-2014582732321794086-2">Under ideal conditions, some bacteria can grow and divide every 20 minutes. If one bacterial cell and all its offspring were to reproduce at this ideal rate, in 48 hours there would be 2.2 &times; 10 43 cells. In reality, bacteria cannot achieve such incredibly large populations, because ... </htmlBody>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the General