示例#1
0
        public virtual void AddRecord(Record record)
        {
            if (Records == null)
                Records = new List<Record>();

            Records.Add(record);
        }
示例#2
0
 private void AddToIndex(Record record, string patientCPF, IndexWriter indexWriter)
 {
     RemoveIndex(record, patientCPF, indexWriter);
     var doc = new Document();
     AddFields(record, doc, patientCPF);
     indexWriter.AddDocument(doc);
 }
示例#3
0
        private Record _mapLuceneDocumentToData(Document doc)
        {
            var record = new Record()
            {
                Code = doc.Get("Code"),
                Hospital = new Hospital { Key = doc.Get("Hospital") },
            };

            return record;
        }
示例#4
0
 private void AddFields(Record record, Document doc, string patientCPF)
 {
     doc.Add(new Field("PatientCPF", patientCPF, Field.Store.YES, Field.Index.ANALYZED));
     doc.Add(new Field("Code", record.Code, Field.Store.YES, Field.Index.ANALYZED));
     doc.Add(new Field("Hospital", record.Hospital.Key, Field.Store.YES, Field.Index.ANALYZED));
 }
示例#5
0
        private void RemoveIndex(Record record, string patientCPF, IndexWriter writer)
        {
            var queryString = " (PatientCPF:" + patientCPF;
            queryString += " AND Code:" + record.Code;
            queryString += " AND Hospital:" + record.Hospital.Key + " )";

            writer.DeleteDocuments(CreateQuery(queryString));
        }