void IContentHandler.AddContent(Document document, JobAdSortContent content) { var time = content.LastRefreshTime == null ? content.JobAd.CreatedTime : content.LastRefreshTime.Value < content.JobAd.CreatedTime ? content.JobAd.CreatedTime : content.LastRefreshTime.Value; AddContent(document, time); }
void IContentHandler.AddContent(Document document, JobAdSortContent content) { if (content.JobAd.Integration.IntegratorUserId != null) { var field = new Field(FieldName.Integrator, content.JobAd.Integration.IntegratorUserId.Value.ToFieldValue(), Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS); field.setOmitTermFreqAndPositions(true); _booster.SetBoost(field); document.add(field); } }
public void AddContent(Document document, JobAdSortContent content) { if (!string.IsNullOrEmpty(content.JobAd.Title)) { document.add(new Field(FieldName.Title, content.JobAd.Title, Field.Store.NO, Field.Index.ANALYZED)); } var companyNames = new[] { content.JobAd.Description.CompanyName, content.JobAd.ContactDetails == null ? null : content.JobAd.ContactDetails.CompanyName, content.Employer.CompanyName }; foreach (var companyName in companyNames.Where(name => !string.IsNullOrEmpty(name))) { document.add(new Field(FieldName.AdvertiserName, companyName, Field.Store.NO, Field.Index.ANALYZED)); } }
void IContentHandler.AddContent(Document document, JobAdSortContent content) { Salary salary = null; if (content.JobAd.Description.Salary == null) { if (content.JobAd.Description.ParsedSalary != null) { salary = content.JobAd.Description.ParsedSalary.ToRate(SalaryRate.Year); } } else { salary = content.JobAd.Description.Salary.ToRate(SalaryRate.Year); } AddContent(document, salary == null ? null : salary.LowerBound, salary == null ? null : salary.UpperBound, true); }
void IContentHandler.AddContent(Document document, JobAdSortContent content) { AddContent(document, content.JobAd.Description.JobTypes); }