[MarkLogic Dev General] <search:match> doesnt list all the
matches in a doc
Colleen.Whitney at marklogic.com
Mon Mar 1 08:22:28 PST 2010
Today's questions first:
Re: snippets, take a look at the API documentation for search:snippet().
You can use search:get-default-options() to see the <transform-results> node that is used by default. You can use <transform-results> to control: snippet length; the amount of padding around each highlighed term; the maximum number of terms; and the elements you prefer to get snippets from. I think that if you increase the maximum snippet size, you'll get closer to what you expect.
We do, by default, return just the first 10 results in the wrapper; you can control the number of results you want returned, and do pagination, using the $start and $page-length parameters. I'm not sure if that's what led to your second and third questions; if that's not it, can you give a more concrete example of what you expected to get, and what you saw?
From: general-bounces at developer.marklogic.com [general-bounces at developer.marklogic.com] On Behalf Of mano m [mano07good at yahoo.co.in]
Sent: Monday, March 01, 2010 12:38 AM
To: General Mark Logic Developer Discussion
Subject: Re: [MarkLogic Dev General] <search:match> doesnt list all the matches in a doc
Why "search:search()" query doesnt give result of all the matches in <search:match> ?
Why "search:search()" skip some of the matches in the <search:response>?
Whether "search:search()" result depends upon source file size or based on license?
From: mano m <mano07good at yahoo.co.in>
To: general at developer.marklogic.com
Sent: Thu, 25 February, 2010 7:17:19 PM
Subject: [MarkLogic Dev General] <search:match> doesnt list all the matches in a doc
I am have used search:search() on the sample xml file given below.I searched for the word "Tourist".In the <search:responce>matches found only in <title>,< AbstractText> tag, not the <review> tag.
What is the reason for this result? Why all the matches are not listed in <search:match> tag?
Even I have tried the same search with/without fragment root "author" I am not getting all the matches.
*Note: I tried the same by reducing the <Review> tag content to two lines then I am getting it in <search:match>.Is content size is the key point here?
let $options := <options xmlns="http://marklogic.com/appservices/search">
Search result :
-<http://localhost:8004/eval.xqy?iefix.txt> <search:response total="1" start="1" page-length="10" xmlns:search="http://marklogic.com/appservices/search">
-<http://localhost:8004/eval.xqy?iefix.txt> <search:result index="1" uri="/Book1.xml" path="doc("/Book1.xml")/library/author" score="784" confidence="0.806436" fitness="0.939024">
-<http://localhost:8004/eval.xqy?iefix.txt> <search:match path="doc("/Book1.xml")/library/author/book/title">
Sample content :
<?xml version="1.0" ?>
<author name="Olen Steinhauer">
<AbstractText>The Tourist is a spy novel that begins on Sept. 10, 2001</AbstractText>
<Review>The Tourist is a spy novel that begins on Sept. 10, 2001, with an elaborately engineered prologue that culminates in a violent confrontation in Venice. The next section of the book takes place in July 2007. The Tourist has jumped to Blackdale, Tenn., and to a new chapter in the life of its title character, Milo Weaver.
>From these facts you might assume that this narrative has moved forward in simple chronological order. The Tourist would like you to know that you would not make a very good spy. Why? Because Olen Steinhauer’s narrative is so carefully larded with lies of omission that there are aspects of the Venice scene that will not be noticed, much less examined, until we are much more deeply immersed in this trickily convoluted novel. Mr. Steinhauer’s book also operates on the principle that this story’s secrets can be coaxed forth only indirectly because it’s a known fact that no decent intelligence operative believes anything he’s told.
The lazy writer of espionage plots need only concoct a world-weary agent and then send him through a string of perilous escapades. Mr. Steinhauer does something much more interesting. Rather than merely describe Milo Weaver’s dizzying exploits, he replicates them; he immerses his reader in the same kind of uncertainty that Milo faces at every turn.So characters in The Tourist have multiple names, opaque motives, deceptive marching orders and vast capacities for duplicity. Incidentally there is a film version in the works, with George Clooney, for anyone who found Syriana too easy to understand.But one of the most diabolical aspects of The Tourist is its illusion of complexity, especially in the first half of the story. While struggling with its opening sections, have faith that Mr. Steinhauer is headed for much more basic, elemental drama. That drama is character driven by the book’s artfully constructed Milo, a man about whom we will learn a great deal before The Tourist is over.
The INTERNET now has a personality. YOURS! See your Yahoo! Homepage<http://in.rd.yahoo.com/tagline_yyi_1/*http://in.yahoo.com/>.
Your Mail works best with the New Yahoo Optimized IE8. Get it NOW!<http://in.rd.yahoo.com/tagline_ie8_new/*http://downloads.yahoo.com/in/internetexplorer/>.
More information about the General