Java Code Examples for org.hibernate.search.annotations.Field

The following are top voted examples for showing how to use org.hibernate.search.annotations.Field. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: my-paper   File: Article.java   Source Code and License 6 votes vote down vote up
/**
 * 获取内容
 * 
 * @return 内容
 */
@Field(store = Store.YES, index = Index.TOKENIZED, analyzer = @Analyzer(impl = IKAnalyzer.class))
@Lob
public String getContent() {
	if (pageNumber != null) {
		String[] pageContents = getPageContents();
		if (pageNumber < 1) {
			pageNumber = 1;
		}
		if (pageNumber > pageContents.length) {
			pageNumber = pageContents.length;
		}
		return pageContents[pageNumber - 1];
	} else {
		return content;
	}
}
 
Example 2
Project: owsi-core-parent   File: GenericListItem.java   Source Code and License 6 votes vote down vote up
@Override
@Fields({
	@Field(name = CODE_FIELD_NAME, analyzer = @Analyzer(definition = HibernateSearchAnalyzer.KEYWORD)),
	@Field(name = CODE_SORT_FIELD_NAME, analyzer = @Analyzer(definition = HibernateSearchAnalyzer.TEXT_SORT))
})
@SortableField(forField = CODE_SORT_FIELD_NAME)
public String getCode() {
	return null;
}
 
Example 3
Project: owsi-core-parent   File: User.java   Source Code and License 6 votes vote down vote up
@Field(analyzer = @Analyzer(definition = HibernateSearchAnalyzer.TEXT_SORT))
@SortableField
public String getSortName() {
	StringBuilder builder = new StringBuilder();
	if(getLastName() != null) {
		builder.append(getLastName());
		builder.append(" ");
	}
	if(getFirstName() != null) {
		builder.append(getFirstName());
	}
	return builder.toString().trim();
}
 
Example 4
Project: my-paper   File: BaseEntity.java   Source Code and License 5 votes vote down vote up
/**
 * 获取创建日期
 * 
 * @return 创建日期
 */
@JsonProperty
@Field(store = Store.YES, index = Index.UN_TOKENIZED)
@DateBridge(resolution = Resolution.SECOND)
@Column(nullable = false, updatable = false)
public Date getCreateDate() {
	return createDate;
}
 
Example 5
Project: my-paper   File: BaseEntity.java   Source Code and License 5 votes vote down vote up
/**
 * 获取修改日期
 * 
 * @return 修改日期
 */
@JsonProperty
@Field(store = Store.YES, index = Index.UN_TOKENIZED)
@DateBridge(resolution = Resolution.SECOND)
@Column(nullable = false)
public Date getModifyDate() {
	return modifyDate;
}
 
Example 6
Project: my-paper   File: Article.java   Source Code and License 5 votes vote down vote up
/**
 * 获取标题
 * 
 * @return 标题
 */
@Field(store = Store.YES, index = Index.TOKENIZED, analyzer = @Analyzer(impl = IKAnalyzer.class))
@NotEmpty
@Length(max = 200)
@Column(nullable = false)
public String getTitle() {
	return title;
}
 
Example 7
Project: my-paper   File: Article.java   Source Code and License 5 votes vote down vote up
/**
 * 获取是否发布
 * 
 * @return 是否发布
 */
@Field(store = Store.YES, index = Index.UN_TOKENIZED)
@NotNull
@Column(nullable = false)
public Boolean getIsPublication() {
	return isPublication;
}
 
Example 8
Project: my-paper   File: Article.java   Source Code and License 5 votes vote down vote up
/**
 * 获取是否置顶
 * 
 * @return 是否置顶
 */
@Field(store = Store.YES, index = Index.UN_TOKENIZED)
@NotNull
@Column(nullable = false)
public Boolean getIsTop() {
	return isTop;
}
 
Example 9
Project: my-paper   File: OrderEntity.java   Source Code and License 5 votes vote down vote up
/**
 * 获取排序
 * 
 * @return 排序
 */
@JsonProperty
@Field(store = Store.YES, index = Index.UN_TOKENIZED)
@Min(0)
@Column(name = "orders")
public Integer getOrder() {
	return order;
}
 
Example 10
Project: my-paper   File: Product.java   Source Code and License 5 votes vote down vote up
/**
 * 获取编号
 * 
 * @return 编号
 */
@JsonProperty
@Field(store = Store.YES, index = Index.UN_TOKENIZED)
@Pattern(regexp = "[\\s\\S]*")
@Length(max = 100)
@Column(nullable = false, unique = true, length = 100)
public String getSn() {
	return sn;
}
 
Example 11
Project: my-paper   File: Product.java   Source Code and License 5 votes vote down vote up
/**
 * 获取名称
 * 
 * @return 名称
 */
@JsonProperty
@Field(store = Store.YES, index = Index.TOKENIZED, analyzer = @Analyzer(impl = IKAnalyzer.class))
@NotEmpty
@Length(max = 200)
@Column(nullable = false)
public String getName() {
	return name;
}
 
Example 12
Project: my-paper   File: Product.java   Source Code and License 5 votes vote down vote up
/**
 * 获取全称
 * 
 * @return 全称
 */
@JsonProperty
@Field(store = Store.YES, index = Index.NO)
@Column(nullable = false)
public String getFullName() {
	return fullName;
}
 
Example 13
Project: my-paper   File: Product.java   Source Code and License 5 votes vote down vote up
/**
 * 获取销售价
 * 
 * @return 销售价
 */
@JsonProperty
@Field(store = Store.YES, index = Index.UN_TOKENIZED)
@NumericField
@FieldBridge(impl = BigDecimalNumericFieldBridge.class)
@NotNull
@Min(0)
@Digits(integer = 12, fraction = 3)
@Column(nullable = false, precision = 21, scale = 6)
public BigDecimal getPrice() {
	return price;
}
 
Example 14
Project: my-paper   File: Product.java   Source Code and License 5 votes vote down vote up
/**
 * 获取市场价
 * 
 * @return 市场价
 */
@Field(store = Store.YES, index = Index.NO)
@Min(0)
@Digits(integer = 12, fraction = 3)
@Column(nullable = false, precision = 21, scale = 6)
public BigDecimal getMarketPrice() {
	return marketPrice;
}
 
Example 15
Project: my-paper   File: Product.java   Source Code and License 5 votes vote down vote up
/**
 * 获取展示图片
 * 
 * @return 展示图片
 */
@JsonProperty
@Field(store = Store.YES, index = Index.NO)
@Length(max = 200)
public String getImage() {
	return image;
}
 
Example 16
Project: my-paper   File: Product.java   Source Code and License 5 votes vote down vote up
/**
 * 获取单位
 * 
 * @return 单位
 */
@JsonProperty
@Field(store = Store.YES, index = Index.NO)
@Length(max = 200)
public String getUnit() {
	return unit;
}
 
Example 17
Project: my-paper   File: Product.java   Source Code and License 5 votes vote down vote up
/**
 * 获取赠送积分
 * 
 * @return 赠送积分
 */
@Field(store = Store.YES, index = Index.NO)
@Min(0)
@Column(nullable = false)
public Long getPoint() {
	return point;
}
 
Example 18
Project: my-paper   File: Product.java   Source Code and License 5 votes vote down vote up
/**
 * 获取是否上架
 * 
 * @return 是否上架
 */
@Field(store = Store.YES, index = Index.UN_TOKENIZED)
@NotNull
@Column(nullable = false)
public Boolean getIsMarketable() {
	return isMarketable;
}
 
Example 19
Project: my-paper   File: Product.java   Source Code and License 5 votes vote down vote up
/**
 * 获取是否列出
 * 
 * @return 是否列出
 */
@Field(store = Store.YES, index = Index.UN_TOKENIZED)
@NotNull
@Column(nullable = false)
public Boolean getIsList() {
	return isList;
}
 
Example 20
Project: my-paper   File: Product.java   Source Code and License 5 votes vote down vote up
/**
 * 获取是否置顶
 * 
 * @return 是否置顶
 */
@Field(store = Store.YES, index = Index.UN_TOKENIZED)
@NotNull
@Column(nullable = false)
public Boolean getIsTop() {
	return isTop;
}
 
Example 21
Project: my-paper   File: Product.java   Source Code and License 5 votes vote down vote up
/**
 * 获取是否为赠品
 * 
 * @return 是否为赠品
 */
@JsonProperty
@Field(store = Store.YES, index = Index.UN_TOKENIZED)
@NotNull
@Column(nullable = false)
public Boolean getIsGift() {
	return isGift;
}
 
Example 22
Project: my-paper   File: Product.java   Source Code and License 5 votes vote down vote up
/**
 * 获取评分
 * 
 * @return 评分
 */
@Field(store = Store.YES, index = Index.UN_TOKENIZED)
@NumericField
@Column(nullable = false, precision = 12, scale = 6)
public Float getScore() {
	return score;
}
 
Example 23
Project: CoCoTemp   File: User.java   Source Code and License 5 votes vote down vote up
/**
 * Gets username.
 *
 * @return the username
 */
@Field(index = org.hibernate.search.annotations.Index.YES, analyze = Analyze.YES, store = Store.NO)
@Analyzer(impl = KeywordAnalyzer.class)
public String getUsername()
{
    return username;
}
 
Example 24
Project: Project-H-Backend   File: Race.java   Source Code and License 5 votes vote down vote up
/**
 * @return Race code
 */
@Override
@Column(name = "code", nullable = false, length = 255, unique=true)
@Field(index=org.hibernate.search.annotations.Index.TOKENIZED, store=Store.NO)
public String getCode() {
	return super.getCode();
}
 
Example 25
Project: UMLS-Terminology-Server   File: ConceptSubsetMemberJpa.java   Source Code and License 5 votes vote down vote up
/**
 * Returns the member name. For JAXB.
 *
 * @return the member name
 */
@Fields({
    @Field(index = Index.YES, store = Store.NO, analyze = Analyze.YES, analyzer = @Analyzer(definition = "noStopWord")),
    @Field(name = "memberNameSort", index = Index.YES, analyze = Analyze.NO, store = Store.NO)
})
public String getMemberName() {
  return member == null ? null : member.getName();
}
 
Example 26
Project: UMLS-Terminology-Server   File: MapSetJpa.java   Source Code and License 5 votes vote down vote up
@Override
@FieldBridge(impl = MapKeyValueToCsvBridge.class)
@Field(name = "alternateTerminologyIds", index = Index.YES, analyze = Analyze.YES, store = Store.NO)
public Map<String, String> getAlternateTerminologyIds() {
  if (alternateTerminologyIds == null) {
    alternateTerminologyIds = new HashMap<>(2);
  }
  return alternateTerminologyIds;
}
 
Example 27
Project: UMLS-Terminology-Server   File: AbstractChecklist.java   Source Code and License 5 votes vote down vote up
@Override
@Fields({
    @Field(name = "name", index = Index.YES, store = Store.NO, analyze = Analyze.YES, analyzer = @Analyzer(definition = "noStopWord"), bridge = @FieldBridge(impl = SplitUnderscoreBridge.class)),
    @Field(name = "nameSort", index = Index.YES, analyze = Analyze.NO, store = Store.NO)
})
public String getName() {
  return name;
}
 
Example 28
Project: UMLS-Terminology-Server   File: WorklistJpa.java   Source Code and License 5 votes vote down vote up
@Fields({
    @Field(bridge = @FieldBridge(impl = CollectionToCsvBridge.class), index = Index.YES, analyze = Analyze.YES, store = Store.NO),
    @Field(name = "reviewersSort", bridge = @FieldBridge(impl = MinValueBridge.class), index = Index.YES, analyze = Analyze.NO, store = Store.NO)
})
@Override
public List<String> getReviewers() {
  if (reviewers == null) {
    reviewers = new ArrayList<>();
  }
  return reviewers;
}
 
Example 29
Project: UMLS-Terminology-Server   File: SourceDataFileJpa.java   Source Code and License 5 votes vote down vote up
@Override
@Fields({
    @Field(index = Index.YES, analyze = Analyze.YES, store = Store.NO),
    @Field(name = "nameSort", index = Index.YES, analyze = Analyze.NO, store = Store.NO)
})
public String getName() {
  return this.name;
}
 
Example 30
Project: UMLS-Terminology-Server   File: ConceptSubsetJpa.java   Source Code and License 5 votes vote down vote up
@Override
@FieldBridge(impl = MapKeyValueToCsvBridge.class)
@Field(name = "alternateTerminologyIds", index = Index.YES, analyze = Analyze.YES, store = Store.NO)
public Map<String, String> getAlternateTerminologyIds() {
  if (alternateTerminologyIds == null) {
    alternateTerminologyIds = new HashMap<>(2);
  }
  return alternateTerminologyIds;
}
 
Example 31
Project: UMLS-Terminology-Server   File: ProjectJpa.java   Source Code and License 5 votes vote down vote up
@XmlJavaTypeAdapter(UserRoleMapAdapter.class)
@Fields({
    @Field(bridge = @FieldBridge(impl = UserRoleBridge.class), index = Index.YES, analyze = Analyze.YES, store = Store.NO),
    @Field(name = "userAnyRole", bridge = @FieldBridge(impl = UserMapUserNameBridge.class), index = Index.YES, analyze = Analyze.YES, store = Store.NO)
})
@Override
public Map<User, UserRole> getUserRoleMap() {
  if (userRoleMap == null) {
    userRoleMap = new HashMap<>();
  }
  return userRoleMap;
}
 
Example 32
Project: UMLS-Terminology-Server   File: ProjectJpa.java   Source Code and License 5 votes vote down vote up
@FieldBridge(impl = MapKeyValueToCsvBridge.class)
@Field(name = "semanticTypeCategoryMap", index = Index.YES, analyze = Analyze.YES, store = Store.NO)
@Override
public Map<String, String> getSemanticTypeCategoryMap() {
  if (semanticTypeCategoryMap == null) {
    semanticTypeCategoryMap = new HashMap<>();
  }
  return semanticTypeCategoryMap;
}
 
Example 33
Project: UMLS-Terminology-Server   File: ConceptJpa.java   Source Code and License 5 votes vote down vote up
@Override
@FieldBridge(impl = CollectionToCsvBridge.class)
@Field(index = Index.YES, analyze = Analyze.YES, store = Store.NO)
public List<String> getLabels() {
  if (labels == null) {
    labels = new ArrayList<>();
  }
  return labels;
}
 
Example 34
Project: UMLS-Terminology-Server   File: RelationshipIdentityJpa.java   Source Code and License 5 votes vote down vote up
@Override
@Field(index = Index.YES, analyze = Analyze.NO, store = Store.NO)
public String getIdentityCode() {
  return additionalRelationshipType + fromId + fromTerminology + fromType
      + relationshipType + terminology + terminologyId + toId + toTerminology
      + toType;
}
 
Example 35
Project: UMLS-Terminology-Server   File: ConceptRelationshipJpa.java   Source Code and License 5 votes vote down vote up
/**
 * Returns the from term. For JAXB.
 *
 * @return the from term
 */
@Fields({
    @Field(index = Index.YES, analyze = Analyze.YES, store = Store.NO, analyzer = @Analyzer(definition = "noStopWord")),
    @Field(name = "fromNameSort", index = Index.YES, analyze = Analyze.NO, store = Store.NO)
})
public String getFromName() {
  return from == null ? null : from.getName();
}
 
Example 36
Project: UMLS-Terminology-Server   File: AtomRelationshipJpa.java   Source Code and License 5 votes vote down vote up
/**
 * Returns the from name. For JAXB.
 *
 * @return the from name
 */
@Fields({
    @Field(index = Index.YES, analyze = Analyze.YES, store = Store.NO, analyzer = @Analyzer(definition = "noStopWord")),
    @Field(name = "fromNameSort", index = Index.YES, analyze = Analyze.NO, store = Store.NO)
})
public String getFromName() {
  return from == null ? null : from.getName();
}
 
Example 37
Project: UMLS-Terminology-Server   File: CodeTreePositionJpa.java   Source Code and License 5 votes vote down vote up
/**
 * Returns the node name. For JAXB.
 *
 * @return the node name
 */
@Fields({
    @Field(name = "nodeName", index = Index.YES, store = Store.NO, analyze = Analyze.YES, analyzer = @Analyzer(definition = "noStopWord")),
    @Field(name = "nodeNameSort", index = Index.YES, analyze = Analyze.NO, store = Store.NO)
})
public String getNodeName() {
  return node == null ? null : node.getName();
}
 
Example 38
Project: UMLS-Terminology-Server   File: UserJpa.java   Source Code and License 5 votes vote down vote up
@Override
@Fields({
    @Field(index = Index.YES, analyze = Analyze.YES, store = Store.NO),
    @Field(name = "nameSort", index = Index.YES, analyze = Analyze.NO, store = Store.NO)
})
public String getName() {
  return name;
}
 
Example 39
Project: UMLS-Terminology-Server   File: AtomRelationshipJpa.java   Source Code and License 5 votes vote down vote up
/**
 * Returns the to name.
 *
 * @return the to name
 */
@Fields({
    @Field(index = Index.YES, analyze = Analyze.YES, store = Store.NO),
    @Field(name = "toNameSort", index = Index.YES, analyze = Analyze.NO, store = Store.NO)
})
public String getToName() {
  return to == null ? null : to.getName();
}
 
Example 40
Project: openyu-commons   File: SeqAuditEntitySupporter.java   Source Code and License 5 votes vote down vote up
@Type(type = "org.openyu.commons.entity.usertype.AuditEntityUserType")
@Column(name = "audit", length = 570)
@Field(store = Store.YES, index = Index.YES, analyze = Analyze.NO)
@FieldBridge(impl = AuditEntityBridge.class)
public AuditEntity getAudit()
{
	return audit;
}
 
Example 41
Project: UMLS-Terminology-Server   File: WorklistNoteJpa.java   Source Code and License 5 votes vote down vote up
/**
 * Returns the worklist id.
 *
 * @return the worklist id
 */
@XmlElement
@FieldBridge(impl = LongBridge.class)
@Field(index = Index.YES, analyze = Analyze.NO, store = Store.NO)
public Long getWorklistId() {
  return (worklist != null) ? worklist.getId() : 0;
}
 
Example 42
Project: UMLS-Terminology-Server   File: ComponentInfoRelationshipJpa.java   Source Code and License 5 votes vote down vote up
/**
 * Returns the to name.
 *
 * @return the to name
 */
@Fields({
    @Field(index = Index.YES, analyze = Analyze.YES, store = Store.NO),
    @Field(name = "toNameSort", index = Index.YES, analyze = Analyze.NO, store = Store.NO)
})
public String getToName() {
  return toName;
}
 
Example 43
Project: UMLS-Terminology-Server   File: DescriptorRelationshipJpa.java   Source Code and License 5 votes vote down vote up
/**
 * Returns the from term. For JAXB.
 *
 * @return the from term
 */
@Fields({
    @Field(index = Index.YES, analyze = Analyze.YES, store = Store.NO, analyzer = @Analyzer(definition = "noStopWord")),
    @Field(name = "fromNameSort", index = Index.YES, analyze = Analyze.NO, store = Store.NO)
})
public String getFromName() {
  return from == null ? null : from.getName();
}
 
Example 44
Project: amanda   File: User.java   Source Code and License 4 votes vote down vote up
@Field
@JsonProperty
@Override
public String getUsername() {
    return username;
}
 
Example 45
Project: amanda   File: User.java   Source Code and License 4 votes vote down vote up
@Field
@JsonProperty
public String getName() {
    return name;
}
 
Example 46
Project: dwnewsbot   File: NewsItem.java   Source Code and License 4 votes vote down vote up
@Field
public String getTitle() {
    return title;
}
 
Example 47
Project: dwnewsbot   File: NewsItem.java   Source Code and License 4 votes vote down vote up
@Field
@Column(length=4096)
public String getSubtitle() {
    return subtitle;
}
 
Example 48
Project: dwnewsbot   File: NewsItem.java   Source Code and License 4 votes vote down vote up
@Field
@Column(columnDefinition = "TEXT")
public String getArticle() {
    return article;
}
 
Example 49
Project: my-paper   File: Article.java   Source Code and License 4 votes vote down vote up
/**
 * 获取作者
 * 
 * @return 作者
 */
@Field(store = Store.YES, index = Index.NO)
@Length(max = 200)
public String getAuthor() {
	return author;
}
 
Example 50
Project: my-paper   File: Product.java   Source Code and License 4 votes vote down vote up
/**
 * 获取重量
 * 
 * @return 重量
 */
@Field(store = Store.YES, index = Index.NO)
@Min(0)
public Integer getWeight() {
	return weight;
}
 
Example 51
Project: my-paper   File: Product.java   Source Code and License 4 votes vote down vote up
/**
 * 获取库存
 * 
 * @return 库存
 */
@Field(store = Store.YES, index = Index.NO)
@Min(0)
public Integer getStock() {
	return stock;
}
 
Example 52
Project: my-paper   File: Product.java   Source Code and License 4 votes vote down vote up
/**
 * 获取已分配库存
 * 
 * @return 已分配库存
 */
@Field(store = Store.YES, index = Index.NO)
@Column(nullable = false)
public Integer getAllocatedStock() {
	return allocatedStock;
}
 
Example 53
Project: my-paper   File: Product.java   Source Code and License 4 votes vote down vote up
/**
 * 获取介绍
 * 
 * @return 介绍
 */
@Field(store = Store.YES, index = Index.TOKENIZED, analyzer = @Analyzer(impl = IKAnalyzer.class))
@Lob
public String getIntroduction() {
	return introduction;
}
 
Example 54
Project: my-paper   File: Product.java   Source Code and License 4 votes vote down vote up
/**
 * 获取搜索关键词
 * 
 * @return 搜索关键词
 */
@Field(store = Store.YES, index = Index.TOKENIZED, analyzer = @Analyzer(impl = IKAnalyzer.class))
@Length(max = 200)
public String getKeyword() {
	return keyword;
}
 
Example 55
Project: my-paper   File: Product.java   Source Code and License 4 votes vote down vote up
/**
 * 获取评分数
 * 
 * @return 评分数
 */
@Field(store = Store.YES, index = Index.UN_TOKENIZED)
@Column(nullable = false)
public Long getScoreCount() {
	return scoreCount;
}
 
Example 56
Project: my-paper   File: Product.java   Source Code and License 4 votes vote down vote up
/**
 * 获取点击数
 * 
 * @return 点击数
 */
@Field(store = Store.YES, index = Index.UN_TOKENIZED)
@Column(nullable = false)
public Long getHits() {
	return hits;
}
 
Example 57
Project: my-paper   File: Product.java   Source Code and License 4 votes vote down vote up
/**
 * 获取周点击数
 * 
 * @return 周点击数
 */
@Field(store = Store.YES, index = Index.NO)
@Column(nullable = false)
public Long getWeekHits() {
	return weekHits;
}
 
Example 58
Project: my-paper   File: Product.java   Source Code and License 4 votes vote down vote up
/**
 * 获取月点击数
 * 
 * @return 月点击数
 */
@Field(store = Store.YES, index = Index.NO)
@Column(nullable = false)
public Long getMonthHits() {
	return monthHits;
}
 
Example 59
Project: my-paper   File: Product.java   Source Code and License 4 votes vote down vote up
/**
 * 获取销量
 * 
 * @return 销量
 */
@Field(store = Store.YES, index = Index.UN_TOKENIZED)
@Column(nullable = false)
public Long getSales() {
	return sales;
}
 
Example 60
Project: my-paper   File: Product.java   Source Code and License 4 votes vote down vote up
/**
 * 获取周销量
 * 
 * @return 周销量
 */
@Field(store = Store.YES, index = Index.NO)
@Column(nullable = false)
public Long getWeekSales() {
	return weekSales;
}