static SearchMapping buildMappingDefinition() { SearchMapping mapping = new SearchMapping(); mapping .entity( TelephoneRecord.class ) .indexed() .indexName( "phoneNumbersIndex" ) .property( "id", ElementType.FIELD ).documentId() .property( "phone", ElementType.FIELD ).field().analyze( Analyze.NO ).store( Store.YES ) .entity( AddressBook.class ) .indexed() .indexName( "addressBookIndex" ) .property( "id", ElementType.FIELD ).documentId() .property( "name", ElementType.FIELD ).field().store( Store.YES ) ; return mapping; }
.entity(InternalProcessDefinition.class).indexed().indexName("process_definition") .property("dbid", ElementType.FIELD).documentId().name(ProcessDefinitionIndex.DBID) .entity(LightProcessDefinitionImpl.class) .property("uuid", ElementType.FIELD).field().name(ProcessDefinitionIndex.UUID) .bridge(UUIDFieldBridge.class) .property("categoryNames", ElementType.METHOD).field().name(ProcessDefinitionIndex.CATEGORY_NAME) .bridge(StringSetFieldBridge.class) .entity(NamedElementImpl.class) .property("name", ElementType.METHOD).field().name(ProcessDefinitionIndex.NAME) .entity(DescriptionElementImpl.class) // share with All DescriptionElement: processes, groups, ... .index(Index.UN_TOKENIZED).dateBridge(Resolution.MILLISECOND) .entity(UserImpl.class).indexed().indexName("user") .property("dbid", ElementType.FIELD).documentId().name(UserIndex.DBID) .property("username", ElementType.FIELD).field().name(UserIndex.NAME) .property("professionalContactInfo", ElementType.FIELD).indexEmbedded() .property("personalContactInfo", ElementType.FIELD).indexEmbedded() .entity(ContactInfo.class) .property("email", ElementType.METHOD).field().name(ContactInfoIndex.EMAIL) .property("phoneNumber", ElementType.METHOD).field().name(ContactInfoIndex.PHONE_NUMBER)
.property( "street2", ElementType.METHOD ) .field().name( "idx_street2" ).store( Store.YES ).boost( 2 ) .entity( ProvidedIdEntry.class ).indexed() .providedId().name( "providedidentry.providedid" ).bridge( LongBridge.class ) .property( "name", ElementType.FIELD ) .property( "age", ElementType.FIELD ) .field().name( "providedidentry.age" ).analyzer( EN_ANALYZER_NAME ).index( Index.YES ).store( Store.YES ) .entity( ProductCatalog.class ).indexed() .boost( 2 ) .property( "id", ElementType.FIELD ).documentId().name( "id" ) .name( "price_string" ) .store( Store.YES ) .entity( DynamicBoostedDescLibrary.class ) .dynamicBoost( CustomBoostStrategy.class ) .indexed() .dynamicBoost( CustomFieldBoostStrategy.class ) .field().store( Store.YES ) .entity( Departments.class ) .classBridge( CatDeptsFieldsClassBridge.class ) .name( "branchnetwork" ) .property( "maxEmployees", ElementType.FIELD ) .field().index( Index.YES ).analyze( Analyze.YES ).store( Store.YES ) .entity( BlogEntry.class ).indexed() .property( "title", ElementType.METHOD ) .field()