0
0
Fork 0
Commit Graph

20 Commits

Author SHA1 Message Date
abhinavdangeti 6451c8c37f MB-26396: Handling documents with geopoints in slice format
+ The issue lies with parsing documents containing a geopoint
  in slice format - which wasn't handled.
+ Unit test that verifies the fix.
2018-01-29 18:31:56 -08:00
Sreekanth Sivasankaran 53aef2104e fixing err handling in UTs, name changes 2018-01-10 22:00:26 +05:30
Sreekanth Sivasankaran 4c256f5669 DocValue Config, new API Changes
-VisitableDocValueFields API for persisted DV field list
-making dv configs overridable at field level
-enabling on the fly/runtime un inverting of doc values
-few UT updates
2018-01-08 10:58:33 +05:30
Sreekanth Sivasankaran 61ba81e964 Merge branch 'scorch', remote-tracking branch 'origin' into docValue_persisted 2017-12-30 16:52:51 +05:30
Damien Tournoud 74b882640e
mapping: Fix closestDocMapping selecting wrong mapping 2017-12-13 15:19:21 -08:00
Marty Schoch 23f6dc1cc6 working in-memory version 2017-11-29 11:33:35 -05:00
Marty Schoch 930c06dfec rewrote logic to be more obvious
found during code walkthrough on 8/24/2017
2017-08-25 09:30:16 -07:00
Marty Schoch 7274dddd2e fix nil ptr panic on newly introduced text marshaler support
We recenlty introduced support for indexing the content of
things implementing TextMarshaler.  Since often times interfaces
are implemented via pointer receivers, we added support to
introspect pointers (previously we just dereferenceed them and
traversed into their underlying structs).  However, in doing so
we neglected to consider the case where the pointer does
implement the interface we care about, but happens to be nil.

fixes #603
2017-06-05 10:08:10 -04:00
Marty Schoch 64c9c61a22 Merge pull request #593 from mschoch/add-text-marshaler
add support for mapping to recognize/use TextMarshaler interface
2017-05-19 09:54:09 -04:00
Marty Schoch 0cbe211120 add support for BleveType() alternative for type detection
Many existing structs already have a Type field or method which
conflicts with the bleve Classifier interface.  To address this
without breaking existing applications, we introduce an
alternate BleveType() method which will be checked first.  The
interface describing this method is private, as it should never
need to be referenced outside this package.

fixes #283
2017-05-19 09:22:12 -04:00
Marty Schoch 9359a69ee5 add support for mapping to recognize/use TextMarshaler interface
Sometimes you have structs which contain data which isn't
exported, or for which the correct data to index isn't just the
contents of it's exported fields.  In these cases your struct
can implement TextMarshaler to return a suitable text
representation.

Previously bleve did not recognize this interface and do anything
to use it.  Now, if the field containing such a struct is
explicitly mapped as "text" and if the struct (or pointer to it)
implements TextMarshaler, we index a text field with the
contents returned by MarshalText().

For backwards compatibilty, dynamic mappings will never use
this feature, and will continue to traverse into the struct
and index the exported fields directly.

fixes #281
2017-05-18 15:08:33 -04:00
Marty Schoch a16efa5e78 add experimental support for indexing/query geo points
New field type GeoPointField, or "geopoint" in mapping JSON.

Currently structs and maps are considered when a mapping explicitly
marks a field as type "geopoint".  Several variants of "lon", "lng", and "lat"
are looked for in map keys, struct field names, or method names.

New query type GeoBoundingBoxQuery searches for documents which have a
GeoPointField indexed with a value that is inside the specified bounding box.

New query type GeoDistanceQuery searches for documents which have a
GeoPointField indexed with a value that is less than or equal to the
specified distance from the specified location.

New sort by method "geo_distance".  Hits can be sorted by their distance
from the specified location.

New geo utility package with all routines ported from Lucene.

New FilteringSearcher, which wraps an existing Searcher, but filters
all hits with a user-provided callback.
2017-03-24 17:22:21 -07:00
Marty Schoch 3b2bc30b54 fix type identification when object indexed is pointer to struct
fixes #508
2016-12-08 08:07:38 -05:00
rob mccoll 43b5b36a19 adding override for "json" in struct tags, tests 2016-10-25 10:42:40 -04:00
Marty Schoch f05dc237ab fix comment in wrong format 2016-10-02 11:10:05 -04:00
Marty Schoch 2332455bd2 nicer formatting of license header 2016-10-02 10:13:14 -04:00
Marty Schoch 6bf9dd59ab BREAKING CHANGE - additional package renaming
i recently learned that package names should also prefer the
singular form, not the plural form
2016-10-01 17:20:59 -04:00
Marty Schoch 35da361bfa BREAKING CHANGE - renamed packages to be shorter and not use _
this commit only addresses the analysis sub-package
2016-09-30 12:36:10 -04:00
Marty Schoch 073c4d0ebd fix issues identified by go vet 2016-09-29 14:54:17 -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