public void Update(IIndexableItem data, FieldConfig config) { Requires.NotNull(data); Delete(data); Add(data, config); }
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); } }
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)); }
public void Update(IIndexableItem data, FieldConfig config) { if (null == data) { throw new ArgumentNullException("data"); } Delete(data); Add(data, config); }
/// <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); }
/// <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); }
public void Index(string indexName, IIndexableItem item) { throw new NotImplementedException(); }
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); }
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)); }