Exemplo n.º 1
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));
 }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
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));
        }