I was expecting:
$ bleve_dump -index /index -docID 123 -fields html
to print only the terms for "html" field in specified document. The
command now detects extra arguments and flag collisions.
This is convenient to see either complicated queries build
programmatically, or to make sure the query parser does what it is
expected to do.
Note only queries made of bleve basic queries are supported. If we
wanted to support external queries, for instance string queries with an
alternative parser, I suggest to introduce some kind of:
type ExpandableQuery interface {
Query
Expand(*IndexMapping) (Query, error)
}
and type assert to that instead of *queryStringQuery.
Two issues:
- Seeking before i.start and iterating returned keys before i.start
- Seeking after the store last key did not invalidate the iterator and
could cause infinite loops.
sed is used to massage the .go files output from nex and yacc.
However, the -i (in-place) option works slightly differently
between gnu (eg Linux) and bsd (eg OSX) sed.
This change should make it work on both flavours.
It boils down to:
1. client sends some work and a notification channel to a single worker,
then waits.
2. worker processes the work
3. worker sends the result to the client using the notification channel
I do not see any problem with this, even with unbuffered channels.
Use this option when rebuilding indexes from scratch. In my small case
(~17000 json documents), it reduces indexing from 520s to 250s.
I did not add any test, short of forced indexing termination it only
has performance effects, which are hard to test. And unknown options are
currently ignored.
Issue #240
I stumbled onto that while trying to understand how analyzers are
resolved. The new code looks simpler to me and removes useless calls to
DocumentMapping.defaultAnalyzerName() when an analyzer is set at
FieldMapping level.
The slight change to TestStoredFieldPreserved avoids a stacktrace when
the test fails.