Ejemplo n.º 1
0
 private IEnumerable<IndexingError> ExecuteAddPost(SearchEngineEntry entry)
 {
     if (entry.IsPublished)
         return SearchEngineService.AddPost(entry);
     SearchEngineService.RemovePost(entry.EntryId);
     return new List<IndexingError>();
 }
Ejemplo n.º 2
0
 private IEnumerable <IndexingError> ExecuteAddPost(SearchEngineEntry entry)
 {
     if (entry.IsPublished)
     {
         return(SearchEngineService.AddPost(entry));
     }
     SearchEngineService.RemovePost(entry.EntryId);
     return(new List <IndexingError>());
 }
Ejemplo n.º 3
0
        protected virtual Document CreateDocument(SearchEngineEntry post)
        {
            var doc = new Document();

            var postId = new Field(Entryid,
                                   NumericUtils.IntToPrefixCoded(post.EntryId),
                                   Field.Store.YES,
                                   Field.Index.NOT_ANALYZED,
                                   Field.TermVector.NO);

            var title = new Field(Title,
                                  post.Title,
                                  Field.Store.YES,
                                  Field.Index.ANALYZED,
                                  Field.TermVector.YES);

            title.SetBoost(_settings.Parameters.TitleBoost);

            var body = new Field(Body,
                                 post.Body,
                                 Field.Store.NO,
                                 Field.Index.ANALYZED,
                                 Field.TermVector.YES);

            body.SetBoost(_settings.Parameters.BodyBoost);

            var tags = new Field(Tags,
                                 post.Tags,
                                 Field.Store.NO,
                                 Field.Index.ANALYZED,
                                 Field.TermVector.YES);

            tags.SetBoost(_settings.Parameters.TagsBoost);

            var blogId = new Field(Blogid,
                                   NumericUtils.IntToPrefixCoded(post.BlogId),
                                   Field.Store.NO,
                                   Field.Index.NOT_ANALYZED,
                                   Field.TermVector.NO);


            var published = new Field(Published,
                                      post.IsPublished.ToString(),
                                      Field.Store.NO,
                                      Field.Index.NOT_ANALYZED,
                                      Field.TermVector.NO);

            var pubDate = new Field(Pubdate,
                                    DateTools.DateToString(post.PublishDate, DateTools.Resolution.MINUTE),
                                    Field.Store.YES,
                                    Field.Index.NOT_ANALYZED,
                                    Field.TermVector.NO);

            var groupId = new Field(Groupid,
                                    NumericUtils.IntToPrefixCoded(post.GroupId),
                                    Field.Store.NO,
                                    Field.Index.NOT_ANALYZED,
                                    Field.TermVector.NO);

            var blogName = new Field(BlogName,
                                     post.BlogName,
                                     Field.Store.YES,
                                     Field.Index.NO,
                                     Field.TermVector.NO);

            var postName = new Field(EntryName,
                                     post.EntryName ?? "",
                                     Field.Store.YES,
                                     Field.Index.NO,
                                     Field.TermVector.NO);

            postName.SetBoost(_settings.Parameters.EntryNameBoost);


            doc.Add(postId);
            doc.Add(title);
            doc.Add(body);
            doc.Add(tags);
            doc.Add(blogId);
            doc.Add(published);
            doc.Add(pubDate);
            doc.Add(groupId);
            doc.Add(blogName);
            doc.Add(postName);

            return(doc);
        }
Ejemplo n.º 4
0
 public IEnumerable <IndexingError> AddPost(SearchEngineEntry post)
 {
     return(AddPosts(new[] { post }, false));
 }
 public IEnumerable<IndexingError> AddPost(SearchEngineEntry post)
 {
     return AddPosts(new[] { post }, false);
 }
Ejemplo n.º 6
0
 public IndexingError(SearchEngineEntry entry, Exception exception)
 {
     Entry     = entry;
     Exception = exception;
 }
Ejemplo n.º 7
0
 public IndexingError(SearchEngineEntry entry, Exception exception)
 {
     Entry = entry;
     Exception = exception;
 }