• Views
  • Iteration Report
  • My Iteration Report
  •  
OMERO.server
  • Login
  • Help/Guide
  • About Trac
  • Preferences
  • Wiki
  • Timeline
  • Roadmap
  • Browse Source
  • View Tickets
  • Search

Context Navigation

  • ← Previous Changeset
  • Next Changeset →

Changeset 2460

Show
Ignore:
Timestamp:
06/04/08 09:52:20 (6 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:
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  
    7171    <property name="queryService" ref="internal:ome.api.LocalQuery"/> 
    7272    <property name="template" ref="simpleJdbcTemplate"/> 
    73     <property name="key" value="PersistentEventLogLoader.current_id"/> 
     73    <property name="key" value="PersistentEventLogLoader.v2.current_id"/> 
    7474    <property name="query" value="select value from configuration where name = ?"/> 
    7575    <property name="insert" value="insert into configuration (name, value) values (?,?)"/> 
  • trunk/components/server/src/ome/services/fulltext/FullTextBridge.java

    r2459 r2460  
    169169            List<Annotation> list = annotated.linkedAnnotationList(); 
    170170            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                } 
    171177                if (annotation instanceof TextAnnotation) { 
    172178                    TextAnnotation text = (TextAnnotation) annotation; 
    … …  
    329335    } 
    330336 
     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 
    331355} 
  • trunk/components/server/test/ome/server/itests/search/SearchTest.java

    r2459 r2460  
    148148        assertTrue(list.toString(), list.size() == 1); 
    149149 
     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 
    150158    } 
    151159 

Download in other formats:

  • Unified Diff
  • Zip Archive

Trac Powered

Powered by Trac 0.11
By Edgewall Software.

Visit the Trac open source project at
http://trac.edgewall.org/