Changeset 2460
- Timestamp:
- 06/04/08 09:52:20 (6 months ago)
- Location:
- trunk/components/server
- Files:
-
- 3 modified
-
resources/ome/services/service-ome.api.Search.xml (modified) (1 diff)
-
src/ome/services/fulltext/FullTextBridge.java (modified) (2 diffs)
-
test/ome/server/itests/search/SearchTest.java (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/components/server/resources/ome/services/service-ome.api.Search.xml
r2354 r2460 71 71 <property name="queryService" ref="internal:ome.api.LocalQuery"/> 72 72 <property name="template" ref="simpleJdbcTemplate"/> 73 <property name="key" value="PersistentEventLogLoader. current_id"/>73 <property name="key" value="PersistentEventLogLoader.v2.current_id"/> 74 74 <property name="query" value="select value from configuration where name = ?"/> 75 75 <property name="insert" value="insert into configuration (name, value) values (?,?)"/> -
trunk/components/server/src/ome/services/fulltext/FullTextBridge.java
r2459 r2460 169 169 List<Annotation> list = annotated.linkedAnnotationList(); 170 170 for (Annotation annotation : list) { 171 String at = annotationTypeString(annotation); 172 add(document, "annotation.type", at, store, index, boost); 173 if (annotation.getNs() != null) { 174 add(document, "annotation.ns", annotation.getNs(), store, 175 index, boost); 176 } 171 177 if (annotation instanceof TextAnnotation) { 172 178 TextAnnotation text = (TextAnnotation) annotation; … … 329 335 } 330 336 337 /** 338 * Return the short type name of an {@link Annotation}. If the instance is 339 * an {@link ome.model.annotations.TextAnnotation} the returned value will 340 * be "TextAnnotation". 341 * 342 * @param annotation 343 * @return 344 */ 345 private String annotationTypeString(Annotation annotation) { 346 Class ac = Utils.trueClass(annotation.getClass()); 347 int dot = ac.getName().lastIndexOf('.'); 348 if (dot < 0) { 349 dot = -1; 350 } 351 String at = ac.getName().substring(dot + 1, ac.getName().length()); 352 return at; 353 } 354 331 355 } -
trunk/components/server/test/ome/server/itests/search/SearchTest.java
r2459 r2460 148 148 assertTrue(list.toString(), list.size() == 1); 149 149 150 list = this.iQuery.findAllByFullText(Image.class, 151 "annotation.ns:theNamespace*", null); 152 assertTrue(list.toString(), list.size() >= 1); 153 154 list = this.iQuery.findAllByFullText(Image.class, 155 "annotation.type:TagAnnotation", null); 156 assertTrue(list.toString(), list.size() >= 1); 157 150 158 } 151 159
