Пример #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void insert(java.util.List<Object> data) throws java.io.IOException
        private void Insert(IList <object> data)
        {
            for (int i = 0; i < data.Count; i++)
            {
                Document doc = LuceneDocumentStructure.documentRepresentingProperties(i, Values.of(data[i]));
                _writer.addDocument(doc);
            }
            _searcherManager.maybeRefreshBlocking();
        }
Пример #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private void insert(java.util.Collection<org.neo4j.values.storable.Value> data) throws java.io.IOException
        private void Insert(ICollection <Value> data)
        {
            Value[] dataArray = data.toArray(new Value[data.Count]);
            for (int i = 0; i < dataArray.Length; i++)
            {
                Document doc = LuceneDocumentStructure.documentRepresentingProperties(i, dataArray[i]);
                _index.IndexWriter.addDocument(doc);
            }
            _index.maybeRefreshBlocking();
        }
Пример #3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static void insertDocument(org.neo4j.kernel.api.impl.index.partition.WritableIndexPartition partition, long nodeId, Object propertyValue) throws java.io.IOException
        private static void InsertDocument(WritableIndexPartition partition, long nodeId, object propertyValue)
        {
            Document doc = LuceneDocumentStructure.documentRepresentingProperties(nodeId, Values.of(propertyValue));

            partition.IndexWriter.addDocument(doc);
        }
Пример #4
0
        public override void Process <T1>(IndexEntryUpdate <T1> update)
        {
            long nodeId = update.EntityId;

            try
            {
                switch (update.UpdateMode())
                {
                case ADDED:
                    Added(update);
                    _writer.updateDocument(LuceneDocumentStructure.newTermForChangeOrRemove(nodeId), LuceneDocumentStructure.documentRepresentingProperties(nodeId, update.Values()));
                    break;

                case CHANGED:
                    Changed(update);
                    _writer.updateDocument(LuceneDocumentStructure.newTermForChangeOrRemove(nodeId), LuceneDocumentStructure.documentRepresentingProperties(nodeId, update.Values()));
                    break;

                case REMOVED:
                    Removed(update);
                    _writer.deleteDocuments(LuceneDocumentStructure.newTermForChangeOrRemove(nodeId));
                    break;

                default:
                    throw new System.InvalidOperationException("Unknown update mode " + Arrays.ToString(update.Values()));
                }
            }
            catch (IOException e)
            {
                throw new UncheckedIOException(e);
            }
        }
Пример #5
0
 private static Document UpdateAsDocument <T1>(IndexEntryUpdate <T1> update)
 {
     return(LuceneDocumentStructure.documentRepresentingProperties(update.EntityId, update.Values()));
 }
Пример #6
0
 public static Document DocumentRepresentingProperties(long nodeId, params object[] objects)
 {
     return(LuceneDocumentStructure.documentRepresentingProperties(nodeId, Values.values(objects)));
 }