Eric,
search:search will only return paths matching your searchable expression. You
could pass //title as part of your $paths variable, or change your searchable
expression:
{concat($path,"|//title")}.
-Will
From: general-boun...@developer.marklogic.com
[mailto:general-boun...@developer.marklogic.com] On Behalf Of Erik Zander
Sent: Tuesday, June 19, 2012 8:40 AM
To: general@developer.marklogic.com
Subject: [MarkLogic Dev General] Search:Search result attribute path not
returning full path on exact match
Hi
I have a problem with the search:search function and the result it gives me.
The problem shows when I for example searches for the word Polikliniskt in the
following structure
Mätning av blodtryck
Polikliniskt
Under normala fysiologiska förhållande föreligger stora variationer i
blodtryck
The resulting path attribute in the matches element in search result for
Polikliniskt do not contains the title element only "//section/section". In
other words the resulting path is "//section/section" instead of
"//section/section/title"
This behavior only occurs when the search term exactly matches the text within
one element so if it's only one word i.e. title above or when quotes are used
to indicate match exactly like "Mätning av blodtryck".
The search options can be found below for even more information.
param $searchString (string) The query string
param $paths (???)
return (xml) The result
:)
declare function medlib:getSearchResult($searchQueryString, $path) {
let $options :=
http://marklogic.com/appservices/search";>
{$path}
score-logtfidf
filtered
10
(: true:)
lang=sv
wildcarded
case-insensitive
whitespace-insensitive
punctuation-insensitive
diacritic-sensitive
100
2000
4
true
let $result := search:search($searchQueryString, $options)
return $result
Regards
Erik Zander
Developer @
Studentlitteratur AB
___
General mailing list
General@developer.marklogic.com
http://community.marklogic.com/mailman/listinfo/general