Changeset 24059
- Timestamp:
- 08/21/07 14:30:27 (3 years ago)
- Files:
-
- org.nuxeo.ecm.platform/trunk/nuxeo-platform-search-api/src/main/resources/OSGI-INF/querymodel-framework.xml (modified) (1 diff)
- org.nuxeo.ecm.platform/trunk/nuxeo-platform-search-api/src/test/java/org/nuxeo/ecm/core/search/api/querymodel/QueryModelTestCase.java (modified) (1 diff)
- org.nuxeo.ecm.platform/trunk/nuxeo-platform-search-api/src/test/resources/querymodel-components-test-setup.xml (modified) (1 diff)
- org.nuxeo.ecm.platform/trunk/nuxeo-platform-search-api/src/test/resources/schema/querymodel-test.xsd (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
org.nuxeo.ecm.platform/trunk/nuxeo-platform-search-api/src/main/resources/OSGI-INF/querymodel-framework.xml
r24056 r24059 24 24 from the document model instead. The interpretation of the 25 25 parameters follow a structure defined by the ``whereClause`` 26 attribute of the QueryModelDescritor class. 26 attribute of the QueryModelDescriptor class. A parameter *name* can occur 27 several times, possibly with different values within a single where clause. 27 28 28 Among other things, it's possible to register an escaper to configure 29 Among other things, it's possible to register an escaper to configure 29 30 which special characters should be escaped in fulltext-like fields ( 30 "escaper" attribute) for STATEFUL query models. 31 31 "escaper" attribute) for STATEFUL query models. 32 32 33 Stateless ones are usually handled by some applicative code that 33 34 can take care of this. This typically depends on both the search backend and org.nuxeo.ecm.platform/trunk/nuxeo-platform-search-api/src/test/java/org/nuxeo/ecm/core/search/api/querymodel/QueryModelTestCase.java
r23319 r24059 146 146 documentModel.setProperty("querymodel_test", "intfield", 3); 147 147 148 // adding a value to the excluded int field that points to the same 149 // parameter 150 documentModel.setProperty("querymodel_test", "intfield_excluded", 1); 151 assertEquals( 152 "SELECT * FROM Document WHERE textparameter = 'some text' " + 153 "AND intparameter < 3 AND intparameter != 1", 154 descriptor.getQuery(documentModel)); 155 148 156 // setting a null or an empty value removes the corresponding predicate 149 157 // from the where clause: 150 158 151 159 documentModel.setProperty("querymodel_test", "textfield", ""); 160 documentModel.setProperty("querymodel_test", "intfield_excluded", null); 152 161 153 162 assertEquals("SELECT * FROM Document WHERE intparameter < 3", org.nuxeo.ecm.platform/trunk/nuxeo-platform-search-api/src/test/resources/querymodel-components-test-setup.xml
r22280 r24059 53 53 <predicate parameter="intparameter" operator="<"> 54 54 <field schema="querymodel_test" name="intfield" /> 55 </predicate> 56 57 <!-- One can have several predicates on the same parameter --> 58 <predicate parameter="intparameter" operator="!="> 59 <field schema="querymodel_test" name="intfield_excluded"/> 55 60 </predicate> 56 61 org.nuxeo.ecm.platform/trunk/nuxeo-platform-search-api/src/test/resources/schema/querymodel-test.xsd
r22984 r24059 10 10 11 11 <xs:element name="intfield" type="xs:integer" /> 12 13 <xs:element name="intfield_excluded" type="xs:integer" /> 12 14 13 15 <xs:element name="boolfield" type="xs:boolean" />
