chef-golang icon indicating copy to clipboard operation
chef-golang copied to clipboard

Partial search support

Open josephholsten opened this issue 10 years ago • 9 comments

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

josephholsten avatar Mar 13 '14 16:03 josephholsten

pull requests welcome!

marpaia avatar Mar 13 '14 21:03 marpaia

I'm working on it, I don't mean to be a leach user.

josephholsten avatar Mar 13 '14 22:03 josephholsten

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.

spheromak avatar Apr 26 '14 09:04 spheromak

goiardi supports partial support just fine.

ctdk avatar Apr 26 '14 16:04 ctdk

@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.

spheromak avatar Apr 27 '14 08:04 spheromak

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 avatar Apr 27 '14 17:04 ctdk

@ctdk @marpaia @josephholsten #21 shows partial working in test.

spheromak avatar Apr 28 '14 00:04 spheromak

I'll be needing partial search this week, I'm looking forward to it!

josephholsten avatar Apr 28 '14 00:04 josephholsten

@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
}

spheromak avatar Apr 28 '14 00:04 spheromak