Hi Amit,
Welcome.
First a bit of general advice, which you may have heard before. Run the
function search:check-options often. Set up your build environment so that it
runs every time you do a search. If it returns empty-sequence, you're golden,
otherwise it's alerting you to current or potential problems. (It does
in-depth checks which take time, so don't run it in a production environment).
It can be tricky to keep track of which config elements are allowed where, but
check-options will keep you on the path.
It looks like the error below comes from having multiple
<searchable-expression>s. Having one inside a <state> should be fine, but not
with a global one too. Since your global one is pointing at fn:collection()
which is the default anyway, you can get rid of it.
Try these and let us know how things turn out.
Thanks, -m
On Jun 6, 2012, at 9:27 PM, amit gope wrote:
Hello All,
I am new to search api and i am having trouble in implementing one
functionality. There are basically two things that i am stuck with:
1. Can i have two operators in the options?
2. I have a code which looks something like this:
<operator name="sort">
<state name="relevance">
<sort-order>
<score/>
</sort-order>
</state>
<state name="date">
<sort-order direction="descending"
type="xs:date" collation="">
<element
ns="http://www.marklogic.com/app/meta" name="Date"/>
</sort-order>
<sort-order>
<score/>
</sort-order>
</state>
</operator>
<operator name="JournalOnlineFirst">
<state name="true">
<searchable-expression>/Publisher[.//JournalOnlineFirst]</searchable-expression>
</state>
</operator>
If my URL has an reads something like this
"localhost:1234://..../q=issn:1573-4803
journalonlinefirst:true&api_key=asdbfdas2342sfda" i want the api to fetch me
those docs which are of the type JournalOnlineFirst. But i get the error as :"
XDMP-ARGTYPE: (err:XPTY0004) fn:in-scope-prefixes((<searchable-expression
xmlns="http://marklogic.com/appservices/search">/Publisher[.//JournalOnlineFirst]</searchable-expression>,
<searchable-expression
xmlns="http://marklogic.com/appservices/search">fn:collection()</searchable-expression>))
-- arg1 is not of type element()"
Please suggest how to achieve the result because i am stuck at this place. I
have also tried something like this.
"<operator name="JournalOnlineFirst">
<state name="true">
</state>
</operator>
<searchable-expression>/Publisher[.//JournalOnlineFirst]</searchable-expression>".
Here i dont get the result, but i dont get the error as well. Please let me
know where i am going wrong. Thanks in advance.
Regards
Amit
_______________________________________________
General mailing list
[email protected]<mailto:[email protected]>
http://community.marklogic.com/mailman/listinfo/general
_______________________________________________
General mailing list
[email protected]
http://community.marklogic.com/mailman/listinfo/general