montezuma's People
montezuma's Issues
optimize-index, persist and flush are not working with thread-safe code
these methods fail after modifying the indexes
EOF condition raised when calling (get-document <index> <big-number>)
Hi
I struck an EOF condition when calling get-document. This code from my src/index/fields-io.lisp
improves the user experience but it should probably report the error to standard-output.
It's easy enough to get the problem condition. Here's the modified code with a handler-case.
(defmethod get-document ((self fields-reader) n)
(handler-case
(with-slots (index-stream fields-stream field-infos) self
(seek index-stream (* n 8))
(let ((position (read-long index-stream)))
(seek fields-stream position))
(let ((doc (make-instance 'document)))
(let ((num-fields (read-vint fields-stream)))
(dotimes (i num-fields)
(let* ((field-number (read-vint fields-stream))
(fi (get-field field-infos field-number))
(bits (read-byte-from-buffer fields-stream)))
(let ((compressed (logbitp +field-is-compressed-bit+ bits))
(tokenize (logbitp +field-is-tokenized-bit+ bits))
(binary (logbitp +field-is-binary-bit+ bits)))
(if binary
(let ((b (make-array (read-vint fields-stream))))
(read-bytes-from-buffer fields-stream b 0 (length b))
(if compressed
(add-field doc
(make-binary-field (field-name fi)
(uncompress b)
:compress))
(add-field doc (make-binary-field (field-name fi) b T))))
(let ((store T)
(index (if (field-indexed-p fi)
(if tokenize
:tokenized
(if (field-omit-norms-p fi)
:no-norms
:untokenized))
NIL))
(data nil))
(if compressed
(progn
(setf store :compress)
(let ((b (make-array (read-vint fields-stream))))
(read-bytes-from-buffer fields-stream b 0 (length b))
(setf data (bytes-to-string (uncompress b)))))
(setf data (read-string fields-stream)))
(let ((stv (if (field-store-term-vector-p fi)
(cond ((and (field-store-positions-p fi)
(field-store-offsets-p fi))
:with-positions-offsets)
((field-store-positions-p fi) :with-positions)
((field-store-offsets-p fi) :with-offsets)
(T T))
NIL)))
(add-field doc (make-field (field-name fi) data
:stored store
:index index
:store-term-vector stv)))))))))
doc))
(error (condition)
nil)))
add-document-to-index returns success, but documents are not actually added to index
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.