0
0
Commit Graph

12 Commits

Author SHA1 Message Date
Marty Schoch
67755618e9 Merge branch 'sedtweak' of https://github.com/bcampbell/bleve into bcampbell-sedtweak 2016-09-01 13:55:15 -04:00
Marty Schoch
5023993895 replaced nex lexer with custom lexer
this improvement was started to improve code coverage
but also improves performance and adds support for escaping

escaping:

The following quoted string enumerates the characters which
may be escaped.

"+-=&|><!(){}[]^\"~*?:\\/ "

Note that this list includes space.

In order to escape these characters, they are prefixed with the \
(backslash) character.  In all cases, using the escaped version
produces the character itself and is not interpretted by the
lexer.

Two simple examples:

my\ name

Will be interpretted as a single argument to a match query
with the value "my name".

"contains a\" character"

Will be interpretted as a single argument to a phrase query
with the value `contains a " character`.

Performance:

before$ go test -v -run=xxx -bench=BenchmarkLexer
BenchmarkLexer-4   	  100000	     13991 ns/op
PASS
ok  	github.com/blevesearch/bleve	1.570s

after$ go test -v -run=xxx -bench=BenchmarkLexer
BenchmarkLexer-4   	  500000	      3387 ns/op
PASS
ok  	github.com/blevesearch/bleve	1.740s
2016-09-01 13:16:07 -04:00
Marty Schoch
8f8bb91439 simplify date parsing in queries, add date to query string
parsing of date ranges in queries no longer consults the
index mapping.  it was deteremined that this wasn't very useful
and led to overly complicated query syntax/behavior.

instead, applications get set the datetime parser used for
date range queries with the top-level config QueryDateTimeParser

also, we now support querying date ranges in the query string,
the syntax is:

field:>"date"

>,>=,<,<= operators are supported
the date must be surrounded by quotes
and must parse in the configured date format
2016-04-22 17:12:10 -04:00
Ben Campbell
592c1cb2d8 Remove leftover .tmp files in go gen phase 2015-10-20 06:53:36 +13:00
Ben Campbell
0e9230178f tweak queryparser 'go generate' lines (portablity)
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.
2015-10-19 11:41:17 +13:00
Marty Schoch
4c269a9f44 when generating parser, run go fmt on the lexer
closes #136
2015-01-02 10:02:20 -08:00
Marty Schoch
9fb6476a0f migrated from genparser.sh to go generate
closes #135
2015-01-01 19:29:16 -08:00
Marty Schoch
78467c0836 refactored yacc parsing code to be threadsafe, removed mutex 2014-10-23 15:56:59 -04:00
Marty Schoch
85b21f8864 change to make generated lexer private 2014-08-29 23:31:40 -04:00
Marty Schoch
bc8e4a81b8 made parse query string private 2014-08-29 19:31:09 -04:00
Marty Schoch
607b038283 refactored boolean query to only depend on query 2014-08-29 16:27:32 -04:00
Marty Schoch
7313e7247e renamed SyntaxQuery QueryStringQuery
also made IndexMeta private
2014-08-29 15:19:02 -04:00