Пример #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));
        }