Exemplo n.º 1
0
        public unsafe bool SeekCeil(ReadOnlyMemory <byte> data)
        {
            using var _ = RocksDbEncoder.EncodeInvertedIndexTerm(data.Span, out var bytes);
            fixed(byte *b = &MemoryMarshal.GetReference(bytes))
            {
                RocksDbIterator.Seek(b, (ulong)bytes.Length);
            }

            UpdateIteratorState();
            return(RocksIteratorValid);
        }
Exemplo n.º 2
0
        protected void AddInvertedIndexTerm(WriteBatch batch, ReadOnlySpan <byte> property, ReadOnlySpan <byte> term,
                                            int docId)
        {
            var propertyId = AliasStore.GetOrCreate(property);
            var termId     = AliasStore.GetOrCreate(term);

            using (RocksDbEncoder.EncodeInt32(termId, out var termIdBytes))
            {
                using (RocksDbEncoder.EncodeInvertedIndexTerm(term, out var array))
                {
                    batch.Put(array, termIdBytes);
                    AddInvertedIndexPosting(batch, propertyId, termId, docId);
                }
            }
        }