Hi David, You cannot really compare the absolute numbers of a score from one search to another. Scores are designed to produce a relevance order with respect to the other results in that search, not a meaningful number, and they are calculated on the fly based on the specific search results.
So what you should be looking at is whether the order seems reasonable, not the absolute numbers of the score. Because the first search ends up having multiple fragments that it has to roll up score, that might make the absolute numbers of the scores higher than the ones at the inside fragment root (because the tf/idf is fragment based). At any rate, do not try and compare the numbers from search to search, just the order. -Danny -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Steiner, David J. (LNG-DAY) Sent: Wednesday, July 07, 2010 5:54 AM To: General Mark Logic Developer Discussion Subject: Re: [MarkLogic Dev General] Search API and Scoring Fragment Roots Hi Colleen, I hope you don't mind, but I don't think I want to post specific data to the general mailing list... When I don't use the searchable expression, I get this as my top result: <search:response total="241941" start="1" page-length="200" xmlns:search="http://marklogic.com/appservices/search"> <search:result index="1" uri="3S65-JVX0-003B-R0RR-00000-00_norm.xml" path="fn:doc("3S65-JVX0-003B-R0RR-00000-00_norm.xml")" score="72" confidence="0.866025" fitness="0.866025"> <search:snippet> <search:match path="fn:doc("3S65-JVX0-003B-R0RR-00000-00_norm.xml")/normaliz edDoc/normalizedPara[2]">district, court, grant, summary, judgment, petitioner, <search:highlight>employer</search:highlight>...</search:match> </search:snippet> </search:result> <search:result index="2" uri="3S4X-HG40-003B-S2WV-00000-00_norm.xml" path="fn:doc("3S4X-HG40-003B-S2WV-00000-00_norm.xml")" score="64" confidence="0.816497" fitness="0.816497"> <search:snippet> <search:match path="fn:doc("3S4X-HG40-003B-S2WV-00000-00_norm.xml")/normaliz edDoc/normalizedPara[9]">...stated, eleventh, railway, labor, act, usc, eleventh, expend, objection, plaintiff, <search:highlight>employee</search:highlight>, union, fund, support, political, cause, plaintiff, oppose, plaintiff, brought, suit...</search:match> </search:snippet> </search:result> ... When I do use it, I get: <search:response total="241939" start="1" page-length="200" xmlns:search="http://marklogic.com/appservices/search"> <search:result index="1" uri="3S4X-4KJ0-003B-72S4-00000-00_norm.xml" path="fn:doc("3S4X-4KJ0-003B-72S4-00000-00_norm.xml")/normaliz edDoc/normalizedPara[34]" score="64" confidence="0.816497" fitness="0.816497"> <search:snippet> <search:match path="fn:doc("3S4X-4KJ0-003B-72S4-00000-00_norm.xml")/normaliz edDoc/normalizedPara[34]">...authority, jones, opelika, judge, dissent, ground, complain, not, sufficiently, allege, <search:highlight>violate</search:highlight>, due, process, clause, fourteenth, amendment, entitle, petitioner, relief, civil, right...</search:match> </search:snippet> </search:result> <search:result index="2" uri="3S4X-DJD0-003B-S2DT-00000-00_norm.xml" path="fn:doc("3S4X-DJD0-003B-S2DT-00000-00_norm.xml")/normaliz edDoc/normalizedPara[57]" score="56" confidence="0.763763" fitness="0.763763"> <search:snippet> <search:match path="fn:doc("3S4X-DJD0-003B-S2DT-00000-00_norm.xml")/normaliz edDoc/normalizedPara[57]">...sullivan, court, considere, limit, state, libel, law, impose, constitutional, guarantee, <search:highlight>freedom</search:highlight>, </search:match> </search:snippet> </search:result> ... What is the "score" I'm getting without the "searchable-expression" reflect? What does it reflect when I add "searchable expression"? Thanks, David -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Colleen Whitney Sent: Tuesday, July 06, 2010 4:56 PM To: General Mark Logic Developer Discussion Subject: Re: [MarkLogic Dev General] Search API and Scoring Fragment Roots David, Try the <searchable-expression> option. Using your example, with no namespaces, you would do: <searchable-expression> /doc/sub-doc </searchable-expression> Here's an example with namespaces from search:search documentation: <searchable-expression xmlns:ex="http:example.com" xmlns:com="http://company.com">/ex:orders/com:company </searchable-expression> --Colleen Colleen Whitney MarkLogic Corporation Phone +1 650 655 2366 email [email protected] web www.marklogic.com This e-mail and any accompanying attachments are confidential. The information is intended solely for the use of the individual to whom it is addressed. Any review, disclosure, copying, distribution, or use of this e-mail communication by others is strictly prohibited. If you are not the intended recipient, please notify us immediately by returning this message to the sender and delete all copies. Thank you for your cooperation. ________________________________________ From: [email protected] [[email protected]] On Behalf Of Steiner, David J. (LNG-DAY) [[email protected]] Sent: Tuesday, July 06, 2010 1:07 PM To: General Mark Logic Developer Discussion Subject: [MarkLogic Dev General] Search API and Scoring Fragment Roots I've fragmeneted my XML documents at a sub-document level. <doc> <sub-doc>...</sub-doc> <sub-doc>...</sub-doc> <sub-doc>...</sub-doc> <sub-doc>...</sub-doc> </doc> I want to use the search API to get the scores of a query match on the sub-doc fragments. For instance, one document might have a sub-doc that scores 72 and another that scores 56 (using simple scoring here). However, it appears as though only the highest scoring sub-doc is shown per document. If there are two (or more) sub-docs that score the same, they're shown, but that's the only case. I need to see the scores of all of the sub-docs that contain "hits" for each document (assuming their score falls within the top X results, where X is the page-length). Is there a way to do this, or is the only way to get it to happen to actually make the sub-docs into documents? Thanks, David Steiner _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
