forked from marklogic-community/slush-marklogic-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes marklogic-community#160: added collection facet, added comments…
…, removed verbose search: prefix
- Loading branch information
1 parent
20dd81e
commit 667c2b9
Showing
1 changed file
with
103 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,118 @@ | ||
<search:options xmlns:search="http://marklogic.com/appservices/search"> | ||
<search:search-option>unfiltered</search:search-option> | ||
<search:page-length>10</search:page-length> | ||
<search:additional-query> | ||
<options xmlns="http://marklogic.com/appservices/search"> | ||
<search-option>unfiltered</search-option> | ||
<page-length>10</page-length> | ||
|
||
<!-- Limit all searches to this additional query --> | ||
<additional-query> | ||
<cts:not-query xmlns:cts="http://marklogic.com/cts"> | ||
<cts:directory-query> | ||
<cts:uri>/users/</cts:uri> | ||
</cts:directory-query> | ||
</cts:not-query> | ||
</search:additional-query> | ||
<search:term apply="term"> | ||
<search:empty apply="all-results"/> | ||
<search:term-option>punctuation-insensitive</search:term-option> | ||
<search:term-option>stemmed</search:term-option> | ||
</search:term> | ||
<search:grammar> | ||
<search:quotation>"</search:quotation> | ||
<search:implicit> | ||
</additional-query> | ||
|
||
<!-- Full-text search options --> | ||
<term apply="term"> | ||
<empty apply="all-results"/> | ||
<term-option>punctuation-insensitive</term-option> | ||
<term-option>stemmed</term-option> | ||
</term> | ||
|
||
<!-- Default grammer --> | ||
<grammar> | ||
<quotation>"</quotation> | ||
<implicit> | ||
<cts:and-query strength="20" xmlns:cts="http://marklogic.com/cts"/> | ||
</search:implicit> | ||
<search:starter strength="30" apply="grouping" delimiter=")">(</search:starter> | ||
<search:starter strength="40" apply="prefix" element="cts:not-query">-</search:starter> | ||
<search:joiner strength="10" apply="infix" element="cts:or-query" tokenize="word">OR</search:joiner> | ||
<search:joiner strength="20" apply="infix" element="cts:and-query" tokenize="word">AND</search:joiner> | ||
<search:joiner strength="30" apply="infix" element="cts:near-query" tokenize="word">NEAR</search:joiner> | ||
<search:joiner strength="30" apply="near2" consume="2" element="cts:near-query">NEAR/</search:joiner> | ||
<search:joiner strength="50" apply="constraint">:</search:joiner> | ||
<search:joiner strength="50" apply="constraint" compare="LT" tokenize="word">LT</search:joiner> | ||
<search:joiner strength="50" apply="constraint" compare="LE" tokenize="word">LE</search:joiner> | ||
<search:joiner strength="50" apply="constraint" compare="GT" tokenize="word">GT</search:joiner> | ||
<search:joiner strength="50" apply="constraint" compare="GE" tokenize="word">GE</search:joiner> | ||
<search:joiner strength="50" apply="constraint" compare="NE" tokenize="word">NE</search:joiner> | ||
</search:grammar> | ||
<search:sort-order direction="descending"> | ||
<search:score/> | ||
</search:sort-order> | ||
<search:transform-results apply="snippet"> | ||
<search:preferred-elements><search:element ns="" name="body"/></search:preferred-elements> | ||
<search:max-matches>1</search:max-matches> | ||
<search:max-snippet-chars>150</search:max-snippet-chars> | ||
<search:per-match-tokens>20</search:per-match-tokens> | ||
</search:transform-results> | ||
<search:return-query>1</search:return-query> | ||
<search:operator name="results"> | ||
<search:state name="compact"> | ||
<search:transform-results apply="snippet"> | ||
<search:preferred-elements><search:element ns="" name="body"/></search:preferred-elements> | ||
<search:max-matches>1</search:max-matches> | ||
<search:max-snippet-chars>150</search:max-snippet-chars> | ||
<search:per-match-tokens>20</search:per-match-tokens> | ||
</search:transform-results> | ||
</search:state> | ||
<search:state name="detailed"> | ||
<search:transform-results apply="snippet"> | ||
<search:preferred-elements><search:element ns="" name="body"/></search:preferred-elements> | ||
<search:max-matches>2</search:max-matches> | ||
<search:max-snippet-chars>400</search:max-snippet-chars> | ||
<search:per-match-tokens>30</search:per-match-tokens> | ||
</search:transform-results> | ||
</search:state> | ||
</search:operator> | ||
<search:annotation xmlns="http://marklogic.com/appservices/search">Delta options here</search:annotation> | ||
<search:constraint name="eyeColor"> | ||
<search:range type="xs:string" facet="true" collation="http://marklogic.com/collation/codepoint"> | ||
<search:facet-option>limit=5</search:facet-option> | ||
<search:facet-option>frequency-order</search:facet-option> | ||
<search:facet-option>descending</search:facet-option> | ||
<search:json-property>eyeColor</search:json-property> | ||
</search:range> | ||
</search:constraint> | ||
</implicit> | ||
<starter strength="30" apply="grouping" delimiter=")">(</starter> | ||
<starter strength="40" apply="prefix" element="cts:not-query">-</starter> | ||
<joiner strength="10" apply="infix" element="cts:or-query" tokenize="word">OR</joiner> | ||
<joiner strength="20" apply="infix" element="cts:and-query" tokenize="word">AND</joiner> | ||
<joiner strength="30" apply="infix" element="cts:near-query" tokenize="word">NEAR</joiner> | ||
<joiner strength="30" apply="near2" consume="2" element="cts:near-query">NEAR/</joiner> | ||
<joiner strength="50" apply="constraint">:</joiner> | ||
<joiner strength="50" apply="constraint" compare="LT" tokenize="word">LT</joiner> | ||
<joiner strength="50" apply="constraint" compare="LE" tokenize="word">LE</joiner> | ||
<joiner strength="50" apply="constraint" compare="GT" tokenize="word">GT</joiner> | ||
<joiner strength="50" apply="constraint" compare="GE" tokenize="word">GE</joiner> | ||
<joiner strength="50" apply="constraint" compare="NE" tokenize="word">NE</joiner> | ||
</grammar> | ||
|
||
<!-- Default sort order. You can also associate states with sort orders to allow switching sort orders --> | ||
<sort-order direction="descending"> | ||
<score/> | ||
</sort-order> | ||
|
||
<!-- Not used, but the default snippeting behavior if no state (see compact/detailed below) was specified --> | ||
<transform-results apply="snippet"> | ||
<preferred-elements><element ns="" name="body"/></preferred-elements> | ||
<max-matches>1</max-matches> | ||
<max-snippet-chars>150</max-snippet-chars> | ||
<per-match-tokens>20</per-match-tokens> | ||
</transform-results> | ||
|
||
<return-query>1</return-query> | ||
|
||
<!-- This controls the snippet size toggle --> | ||
<operator name="results"> | ||
<state name="compact"> | ||
<transform-results apply="snippet"> | ||
<preferred-elements><element ns="" name="body"/></preferred-elements> | ||
<max-matches>1</max-matches> | ||
<max-snippet-chars>150</max-snippet-chars> | ||
<per-match-tokens>20</per-match-tokens> | ||
</transform-results> | ||
</state> | ||
<state name="detailed"> | ||
<transform-results apply="snippet"> | ||
<preferred-elements><element ns="" name="body"/></preferred-elements> | ||
<max-matches>2</max-matches> | ||
<max-snippet-chars>400</max-snippet-chars> | ||
<per-match-tokens>30</per-match-tokens> | ||
</transform-results> | ||
</state> | ||
</operator> | ||
|
||
<!-- Annotations (allowed pretty much anywhere) allow adding text or elements to feed custom components with options that would normally not validate) --> | ||
<annotation>Delta options here</annotation> | ||
|
||
<!-- Facet based on document collections, simple yet elegant --> | ||
<constraint name="Collection"> | ||
<collection facet="true" /> | ||
<!-- optionally enable a prefix to see a specific subset of facets | ||
<collection facet="true" prefix="data/" /> | ||
--> | ||
</constraint> | ||
|
||
<!-- Example facet based on the sample-data --> | ||
<constraint name="eyeColor"> | ||
<range type="xs:string" facet="true" collation="http://marklogic.com/collation/codepoint"> | ||
<facet-option>limit=5</facet-option> | ||
<facet-option>frequency-order</facet-option> | ||
<facet-option>descending</facet-option> | ||
<json-property>eyeColor</json-property> | ||
</range> | ||
</constraint> | ||
|
||
<!-- example facet constraint below --> | ||
<!-- | ||
<search:constraint name="myconstraint"> | ||
<search:range type="xs:string" facet="true"> | ||
<search:facet-option>limit=5</search:facet-option> | ||
<search:facet-option>frequency-order</search:facet-option> | ||
<search:facet-option>descending</search:facet-option> | ||
<search:element ns="" name="my-el"/> | ||
</search:range> | ||
</search:constraint> | ||
<constraint name="myconstraint"> | ||
<range type="xs:string" facet="true"> | ||
<facet-option>limit=5</facet-option> | ||
<facet-option>frequency-order</facet-option> | ||
<facet-option>descending</facet-option> | ||
<element ns="" name="my-el"/> | ||
</range> | ||
</constraint> | ||
--> | ||
|
||
<!-- example suggestion-source below --> | ||
<!-- | ||
<search:suggestion-source ref="myconstraint"> | ||
<search:suggestion-option>frequency-order</search:suggestion-option> | ||
<search:suggestion-option>descending</search:suggestion-option> | ||
<search:suggestion-option>limit=10</search:suggestion-option> | ||
</search:suggestion-source> | ||
<suggestion-source ref="myconstraint"> | ||
<suggestion-option>frequency-order</suggestion-option> | ||
<suggestion-option>descending</suggestion-option> | ||
<suggestion-option>limit=10</suggestion-option> | ||
</suggestion-source> | ||
--> | ||
|
||
</search:options> | ||
</options> |