Hi Mano, 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? Thanks, --Colleen ________________________________________ From: [email protected] [[email protected]] On Behalf Of mano m [[email protected]] 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 Hi, 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? Regards, Mano ________________________________ From: mano m <[email protected]> To: [email protected] Sent: Thu, 25 February, 2010 7:17:19 PM Subject: [MarkLogic Dev General] <search:match> doesnt list all the matches in a doc Hi, 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? Xquery: let $options := <options xmlns="http://marklogic.com/appservices/search"> <searchable-expression xmlns:xh="http://www.w3.org/1999/xhtml"> //(author| MedlineCitation) </searchable-expression> </options> return search:search("Tourist",$options) 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:snippet> -<http://localhost:8004/eval.xqy?iefix.txt> <search:match path="doc("/Book1.xml")/library/author/book/title"> The <search:highlight>tourist</search:highlight> </search:match> </search:snippet> </search:result> <search:qtext>Tourist</search:qtext> -<http://localhost:8004/eval.xqy?iefix.txt> <search:metrics> <search:query-resolution-time>PT0.156S</search:query-resolution-time> Sample content : <?xml version="1.0" ?> <library> <author name="Olen Steinhauer"> <book> <title>The tourist</title> <year>2009</year> <Publication>Macmillon</Publication> <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. </Review> </book> </author> </library> Regards, Mano ________________________________ 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/>. _______________________________________________ General mailing list [email protected] http://xqzone.com/mailman/listinfo/general
