0
0
Fork 0
Commit Graph

31 Commits

Author SHA1 Message Date
Joachim Schwarm 4ddc50e86d
typo in documentation 2017-11-21 16:35:07 +01:00
Marty Schoch 1eba5541f2 introduce new query TermRange
The term range query is not often used in full-text queries, but
can be useful when filtering on keyword indexed text terms in
the index.

The JSON syntax to do a TermRange query is the same as for
NumericRange, but the min/max values must be string and not
float64.
2017-03-31 22:04:00 -04:00
Marty Schoch 6554e9624f geo review comments from sreekanth
also one fix came from steve, i must have forgotten to push that
commit up before merging
2017-03-31 08:41:40 -04:00
Marty Schoch 9790574610 update to geo query parsing and top-level bleve accessibility
- make geo queries accessible from top-level bleve
- update query parsing to support same geo point formats as
  document parsing
- add constructor for easier sorting by geo distance in Go
- additional integration tests using alternate (GeoJSON) style points
2017-03-30 15:23:27 -04:00
Ben Campbell 11f18333fb Settle on default fuzziness of 1 (for now)
see https://groups.google.com/d/msg/bleve/vkVxnLMlXow/5qM1jL0ZEgAJ
2016-10-04 15:00:50 +13:00
Marty Schoch 2332455bd2 nicer formatting of license header 2016-10-02 10:13:14 -04:00
Marty Schoch b863add129 address code review comments from @steveyen 2016-09-29 14:54:17 -04:00
Marty Schoch ee17941f7f switch DateRangeQuery to use time.Time instead of string
as we are a Go library is this the much more natural way to
express such queries.

support for strings is still supported through json marshal
and unmarshal, as well as inside query string queries

as before we use the package level QueryDateTimeParser to
deterimine which date time parser to use for parsing

only serializing out to json, we consult a new package
variable: QueryDateTimeFormat

this addresses the longstanding PR #255
2016-09-29 14:54:16 -04:00
Marty Schoch 9ec2ddd757 initial refactor of query into separate package 2016-09-29 14:54:16 -04:00
Marty Schoch 79cc39a67e refactor mapping to inteface and move into separate package
the index mapping contains some relatively messy logic
and the top-level bleve package only cares about a relatively
small portion of this
the motivation for this change is to codify the part that the
top-level bleve package cares about into an interface
then move all the details into its own package

NOTE: the top-level bleve package still has hard dependency on
the actual implementation (for now) because it must deserialize
mappings from JSON and simply assumes it is this one instance.
this is seen as OK for now, and this issue could be revisited
in a future change.  moving the logic into a separate package
is seen as a simplification of top-level bleve, even though
we still depend on the one particular implementation.
2016-09-29 14:53:18 -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 5408083ab5 from JSON parsing regexp/wildcard queries defaulted to boost of 0
having boost of 0 led to invalid scores of NaN
added integration test for wildcard query
added ability to run single integration test at a time
added assertion that scoare is not NaN/+Inf/-Inf
2016-02-23 09:22:39 -05:00
Marty Schoch f7698f1f15 support match_all, match_none and docid queries via JSON
also fixed bug in docIDQuery execution which would cause not
matching the highest docID passed in if it was in fact a
valid ID
2015-12-16 14:53:14 -05:00
Sergey Avseyev 8609e7af08 Simplify JSON API for phrase query
New API looks like this:

    {"query":{"terms":["watered","down"],"field":"desc"}}

instead of

    {"query":{"terms":[{"term":"watered","field":"desc"},{"term":"down","field":"desc"}]}}

So that it eliminats accidental errors by supplying terms with different
fields, or different type of query
2015-11-02 21:08:11 +03:00
Patrick Mezard c9619f0359 query: add DumpQuery to expand string query and format them as JSON
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.
2015-10-23 14:52:42 +02:00
Marty Schoch a41f229b14 added regexp and wildcard queries
fixes #152
2015-03-11 16:57:22 -04:00
Marty Schoch 67beaca6d6 fix to phrase/phrase match search involving stop words
closes #122
2014-11-25 10:07:54 -05: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 d485b0ef26 initial impl of fuzzy search 2014-10-23 13:02:29 -04:00
Marty Schoch 198ca1ad4d major refactor of kvstore/index internals, see below
In the index/store package
introduce KVReader
  creates snapshot
  all read operations consistent from this snapshot
  must close to release

introduce KVWriter
  only one writer active
  access to all operations
  allows for consisten read-modify-write
  must close to release

introduce AssociativeMerge operation on batch
  allows efficient read-modify-write
  for associative operations
  used to consolidate updates to the term summary rows
  saves 1 set and 1 get op per shared instance of term in field

In the index package
introduced an IndexReader
  exposes a consisten snapshot of the index for searching

At top level
  All searches now operate on a consisten snapshot of the index
2014-09-12 17:21:35 -04:00
Marty Schoch bbc6fadf69 changed error constants to camel case
all caps constants are not idiomatic go
2014-09-02 14:14:05 -04:00
Marty Schoch 209f808722 improve go docs at the top level
part of #79
2014-08-31 10:55:22 -04:00
Marty Schoch f2c781fa21 refactor to make all the query classes private 2014-08-29 18:14:12 -04:00
Marty Schoch 7313e7247e renamed SyntaxQuery QueryStringQuery
also made IndexMeta private
2014-08-29 15:19:02 -04:00
Marty Schoch 37d3f0205d cleanup spacing between license and package 2014-08-29 14:18:36 -04:00
Marty Schoch 1161361bea rename imports from couchbaselabs to blevesearch 2014-08-28 15:38:57 -04:00
Marty Schoch b0153cecb4 added tests to top level 2014-08-15 15:49:35 -04:00
Marty Schoch 292af78b9e implemented prefix search
closes #4
2014-08-07 13:45:39 -04:00
Marty Schoch 00d6f9700b added support for date range fields and queries
closes #9 and closes #11
2014-08-03 17:19:04 -04:00
Marty Schoch 78465ca686 added initial support for indexing and querying numeric values
closes #8 and closes #10
2014-08-02 19:05:58 -04:00
Marty Schoch 2968d3538a major refactor, apologies for the large commit
removed analyzers (these are now built as needed through config)
removed html chacter filter (now built as needed through config)
added missing license header
changed constructor signature of filters that cannot return errors
filter constructors that can have errors, now have Must variant which panics
change cdl2 tokenizer into filter (should only see lower-case input)
new top level index api, closes #5
refactored index tests to not rely directly on analyzers
moved query objects to top-level
new top level search api, closes #12
top score collector allows skipping results
index mapping supports _all by default, closes #3 and closes #6
index mapping supports disabled sections, closes #7
new http sub package with reusable http.Handler's, closes #22
2014-07-30 12:30:38 -04:00