Skip to content
This repository has been archived by the owner on Nov 10, 2022. It is now read-only.

Commit

Permalink
Can now use attribute maps in query strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryangrimm committed Aug 13, 2011
1 parent 42c7f13 commit 9b0557e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
22 changes: 14 additions & 8 deletions data/lib/search.xqy
Original file line number Diff line number Diff line change
Expand Up @@ -193,15 +193,21 @@ declare function search:mapValueToQuery(
then xs:QName($index/element)
else ()
return
if($index/mode = "equals")
if($index/structure = "xmlattribute")
then
if($value = ("true", "false"))
then cts:or-query((
cts:element-value-query($QName, $value),
cts:element-attribute-value-query($QName, xs:QName("boolean"), $value)
))
else cts:element-value-query($QName, $value)
else cts:element-word-query($QName, $value)
if($index/mode = "equals")
then cts:element-attribute-value-query($QName, xs:QName($index/attribute), $value)
else cts:element-attribute-word-query($QName, xs:QName($index/attribute), $value)
else
if($index/mode = "equals")
then
if($value = ("true", "false"))
then cts:or-query((
cts:element-value-query($QName, $value),
cts:element-attribute-value-query($QName, xs:QName("boolean"), $value)
))
else cts:element-value-query($QName, $value)
else cts:element-word-query($QName, $value)
};

declare function search:fieldValueToQuery(
Expand Down
10 changes: 10 additions & 0 deletions test/js/query-string-parser-tests.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9b0557e

Please sign in to comment.