0
0
Commit Graph

15 Commits

Author SHA1 Message Date
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
46f70bfa12 streamline boost just like tilde 2016-08-31 22:10:44 -04:00
Marty Schoch
37d3750157 simplify parser rules 2016-08-31 21:57:44 -04:00
Marty Schoch
bb285cd0f2 more lexer/parser simplification 2016-08-31 21:53:49 -04:00
Marty Schoch
6c75b7c646 tightening up lexer/parser to prep future work 2016-08-31 21:23:03 -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
Marty Schoch
7ec37d6533 add support for wildcard and regexp queries to query string
you can now use terms like:

test?string*

and similar text in query strings to perform wildcard
searches.  also if you use:

/aregexp/

it will perform a regexp search as well
2016-04-08 15:56:02 -04:00
Marty Schoch
29b4f9623a fix query parser to recognize field prefix before fuzzy tilde 2015-01-19 16:20:32 -05:00
Marty Schoch
0ddfa774ec clean up logging to use package level *log.Logger
by default messages go to ioutil.Discard
2014-12-28 12:14:48 -08:00
Marty Schoch
3a0263bb72 finished initial impl of fuzzy search
you can do a manual fuzzy term search using the FuzzyQuery struct
or, more suitable for most users the MatchQuery now supports
some fuzzy options.  Here you can specify fuzziness and
prefix_length, to turn the underlying term search into a fuzzy
term search.  This has the benefit that analysis is performed
on your input, just like the analyzed field, prior to computing
the fuzzy variants.

closes #82
2014-10-24 13:39:48 -04:00
Marty Schoch
78467c0836 refactored yacc parsing code to be threadsafe, removed mutex 2014-10-23 15:56:59 -04:00
Marty Schoch
af6a5d27eb allow term searches for numbers
closes #108
2014-10-10 20:36:31 -07:00
Marty Schoch
f2c781fa21 refactor to make all the query classes private 2014-08-29 18:14:12 -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