Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

LUCY-284 Support Go host types as doc#21

Merged
asfgit merged 8 commits intoapache:masterfrom
rectang:LUCY-284-go-host-doc
Oct 1, 2015
Merged

LUCY-284 Support Go host types as doc#21
asfgit merged 8 commits intoapache:masterfrom
rectang:LUCY-284-go-host-doc

Conversation

@rectang
Copy link
Contributor

@rectang rectang commented Sep 28, 2015

Support the following types as documents in Go bindings:

  • Doc objects wrapped in Go bindings
  • map[string]interface{}
  • Go structs (field names matched case-insensitively)

Add `NewHitDoc`, move `NewDoc`.
Instead of storing a pointer to a raw Clownfish Hash in a doc object,
wrap the Hash in a Go struct, store it in the registry and store the
ID returned by the registry in the Doc.

This commit is a transition from using a Clownfish Hash as Doc's fields
to using a Go `map[string]interface{}`.
Change from Clownfish Hash to Go map.
*   Doc object
*   Go struct
*   map[string]interface{}
Prepare to read into something other than a Doc object from
DefaultDocReader.
Make it possible to supply multiple types to DocReader.
Support multiple document types when fetching document data via a
Searcher.
Allow 3 different types of object to retrieve fields via Next()
*   Go struct
*   Lucy HitDoc
*   map[string]interface{}
@asfgit asfgit merged commit 1b97823 into apache:master Oct 1, 2015
asfgit pushed a commit that referenced this pull request Oct 1, 2015
It is convenient to be able to use host data types as documents, as they
fit more easily into host idioms than Doc objects. The primary routines
which need to support such types are Indexer's AddDoc() and Hit's
Next(), but it also makes sense to use a Go type internally within Doc.

The three types supported as documents are:

*   Doc objects (within their Go struct wrappers)
*   Go structs (field names mapped case-insensitively)
*   Go `map[string]interface{}`

This closes #21.
@rectang rectang deleted the LUCY-284-go-host-doc branch October 28, 2015 21:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants