Changeset 2460
- Timestamp:
- 06/04/08 09:52:20 (22 months ago)
- Author:
- jmoore
- Message:
-
OmeroSearch : Last upgrades to field names for release.
- Changed PersistentEventLogLoader's look up key to force re-indexing
- Added annotation.ns and annotation.type
- Location:
- trunk/components/server
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
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 (?,?)"/> |
-
|
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 | } |
-
|
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 | |
Download in other formats:
1.2.1-PRO © 2008-2009
agile42 all
rights reserved
(this page was served in: 0.150105 sec.)