コード例 #1
0
        public void Update(IIndexableItem data, FieldConfig config)
        {
            Requires.NotNull(data);

            Delete(data);
            Add(data, config);
        }
コード例 #2
0
 public virtual void Index(string indexName, IIndexableItem item)
 {
     if ((item.TimeToLive.HasValue && item.TimeToLive >= DateTime.Now) || !item.TimeToLive.HasValue)
     {
         var indexResponse = Client.Index <BytesResponse>(indexName, item.Type, item.Id.ToString(), PostData.Serializable(item.ToDictionary()));
         var resp          = Encoding.UTF8.GetString(indexResponse.Body);
     }
 }
コード例 #3
0
 public void Add(IIndexableItem data, FieldConfig config)
 {
     if (null == data)
     {
         throw new ArgumentNullException("data");
     }
     Store.Add(JsonMappingUtils.JsonToDocument(data.GetScope(), data.GetId(), data.GetCreatedByUserId(), data.GetCreatedOnDate(), data.GetData(), data.GetSource(), config));
 }
コード例 #4
0
 public void Update(IIndexableItem data, FieldConfig config)
 {
     if (null == data)
     {
         throw new ArgumentNullException("data");
     }
     Delete(data);
     Add(data, config);
 }
コード例 #5
0
        /// <summary>
        /// Deletes the matching objects in the IndexWriter.
        /// </summary>
        /// <param name="data"></param>
        public void Delete(IIndexableItem data)
        {
            Requires.NotNull(data);

            var   selection   = new TermQuery(new Term(JsonMappingUtils.FIELD_ID, data.GetId()));
            Query deleteQuery = new FilteredQuery(selection, JsonMappingUtils.GetTypeFilter(data.GetScope()));

            Store.Delete(deleteQuery);
        }
コード例 #6
0
        /// <summary>
        /// Deletes the matching objects in the IndexWriter.
        /// </summary>
        /// <param name="data"></param>
        public void Delete(IIndexableItem data)
        {
            if (null == data)
            {
                throw new ArgumentNullException("data");
            }
            var   selection   = new TermQuery(new Term(JsonMappingUtils.FieldId, data.GetId()));
            Query deleteQuery = new FilteredQuery(selection, JsonMappingUtils.GetTypeFilter(data.GetScope()));

            Store.Delete(deleteQuery);
        }
コード例 #7
0
 public void Index(string indexName, IIndexableItem item)
 {
     throw new NotImplementedException();
 }
コード例 #8
0
 public void Index(string indexName, IIndexableItem item)
 {
     var indexResponse = Client.Index <BytesResponse>(indexName, item.Type, item.Id.ToString(), PostData.Serializable(item.ToDictionary()));
     var resp          = Encoding.UTF8.GetString(indexResponse.Body);
 }
コード例 #9
0
        public void Add(IIndexableItem data, FieldConfig config)
        {
            Requires.NotNull(data);

            Store.Add(JsonMappingUtils.JsonToDocument(data.GetScope(), data.GetId(), data.GetCreatedByUserId(), data.GetCreatedOnDate(), data.GetData(), data.GetSource(), config));
        }