[ 
https://issues.apache.org/jira/browse/LUCY-284?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14933923#comment-14933923
 ] 

ASF GitHub Bot commented on LUCY-284:
-------------------------------------

GitHub user rectang opened a pull request:

    https://github.com/apache/lucy/pull/21

    LUCY-284 Support Go host types as doc

    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)

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/rectang/lucy LUCY-284-go-host-doc

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/lucy/pull/21.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #21
    
----
commit a41f86cbcc63b711c8087a4861e70ec803a69ebf
Author: Marvin Humphrey <[email protected]>
Date:   2015-09-16T01:54:11Z

    Change Doc to use registry internally.
    
    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{}`.

commit 8223307d126898cee43286e1e7bafb6f6d149c25
Author: Marvin Humphrey <[email protected]>
Date:   2015-09-16T03:25:31Z

    Switch Doc to `map[string]interface{}`.
    
    Change from Clownfish Hash to Go map.

commit 2bec52c1c8314c68a0687b09a088406ddce3211c
Author: Marvin Humphrey <[email protected]>
Date:   2015-09-19T01:59:27Z

    Allow multiple inputs to Indexer's AddDoc.
    
    *   Doc object
    *   Go struct
    *   map[string]interface{}

commit 776c9aab8bd775d7badb4fbfa50a4df3d731a239
Author: Marvin Humphrey <[email protected]>
Date:   2015-09-23T02:13:55Z

    Refactor DocReader to accept diff doc types.
    
    Prepare to read into something other than a Doc object from
    DefaultDocReader.

commit 900fc89ed074ad9a126e959108ec3573efc1cb31
Author: Marvin Humphrey <[email protected]>
Date:   2015-09-26T00:16:08Z

    Doc, HitDoc constructors Go bindings.
    
    Add `NewHitDoc`, move `NewDoc`.

commit 34ffe42cbc21d248508c76c3bfdd081eb48b23f9
Author: Marvin Humphrey <[email protected]>
Date:   2015-09-26T02:59:06Z

    Private readDoc for DocReader Go bindings.
    
    Make it possible to supply multiple types to DocReader.

commit 853cf863a11be2d6543c90ad5830504081747c0f
Author: Marvin Humphrey <[email protected]>
Date:   2015-09-26T02:59:28Z

    Add ReadDoc to Searcher Go bindings.
    
    Support multiple document types when fetching document data via a
    Searcher.

commit 1b97823de7df7a09826d16070d72dd1922b73072
Author: Marvin Humphrey <[email protected]>
Date:   2015-09-26T03:01:24Z

    Allow diff doc types in Hits.Next() Go binding.
    
    Allow 3 different types of object to retrieve fields via Next()
    *   Go struct
    *   Lucy HitDoc
    *   map[string]interface{}

----


> Support multiple Go types as document
> -------------------------------------
>
>                 Key: LUCY-284
>                 URL: https://issues.apache.org/jira/browse/LUCY-284
>             Project: Lucy
>          Issue Type: Improvement
>          Components: Go bindings
>            Reporter: Marvin Humphrey
>            Assignee: Marvin Humphrey
>             Fix For: 0.5.0
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to