chef-golang
chef-golang copied to clipboard
Partial search support
Partial search is much faster than regular search, and only requires POSTing desired keys to the search query endpoint.
The official client implementation is defined here: partial_search:libraries/partial_search.rb:49
pull requests welcome!
I'm working on it, I don't mean to be a leach user.
fyi @josephholsten @marpaia #19 brings in the basic support in POST to support partial. I need to talk to @ctdk about the goiardi support for partial search. example partial in the test code for POST
Should be simple enough to add a nice 'PartialSearch' method to the search package.
goiardi supports partial support just fine.
@ctdk hrm them possibly i was doing it wrong in my test. I was following what documentation was on the website for the server api to partial search. I guess i should look at pedant. If yer around on irc tomorrow i will ping you.
Yeah, last I checked anyway goiardi was passing the partial search tests in chef-pedant with flying colors. I'm running in-mem no-auth tests right now on the mysql branch (and will be testing the other modes as time permits today), so I'll see how those do with partial search too.
@ctdk @marpaia @josephholsten #21 shows partial working in test.
I'll be needing partial search this week, I'm looking forward to it!
@josephholsten cool the support is there in .Post, but not in the search package. Should be easy nuf to write some types and a wrapper in search if you want to take a crack at it. This is the dumped struct coming back off the unmarshal:
(map[string]interface {}) {
(string) "rows": ([]interface {}) {
(map[string]interface {}) {
(string) "data": (map[string]interface {}) {
(string) "name": (string) "neo4j.example.org"
},
(string) "url": (string) "http://localhost:8443/nodes/neo4j.example.org"
}
},
(string) "start": (float64) 0,
(string) "total": (float64) 1
}