groonga / gcs

Groonga CloudSearch is an open source implementation of Amazon CloudSearch.
http://gcs.groonga.org/
MIT License
25 stars 1 forks source link

Match behaviour of "facet" parameter with missing/nofacet field to the one of Amazon CloudSearch #93

Closed piroor closed 12 years ago

piroor commented 12 years ago

There is no document about such cases.

For missing fields, should we return error responses? Or, simply ignore them? For "nofacet" fields, how should we treat them?

darashi commented 12 years ago

In both cases, 200 returned.

If the field does not exist, just ignored. No facet information is included in the response. The full response is below:

{"rank":"-text_relevance","match-expr":"(label 'tokyo')","hits":{"found":1,"start":0,"hit":[{"id":"tt0463985","data":{"director":["Lin, Justin"],"t":["The Fast and the Furious: Tokyo Drift"],"text_relevance":["334"],"title":["The Fast and the Furious: Tokyo Drift"],"year":["2006"]}}]},"info":{"rid":"8b46e820abdf9c2b6422cf05f897b7f664e130739bb2eeca34ae1ebffef23ecf0e564cc569a29a59","time-ms":3,"cpu-time-ms":0}}

If the field does exist but nofacet (in this example, I've used title text column), the facets value in the search response becomes like this: "facets":{"title":{}}

The full response is below:

{"rank":"-text_relevance","match-expr":"(label 'tokyo')","hits":{"found":1,"start":0,"hit":[{"id":"tt0463985","data":{"director":["Lin, Justin"],"t":["The Fast and the Furious: Tokyo Drift"],"text_relevance":["334"],"title":["The Fast and the Furious: Tokyo Drift"],"year":["2006"]}}]},"facets":{"title":{}},"info":{"rid":"8b46e820abdf9c2b6422cf05f897b7f62009e2db1fc4d212041a01767e4e6f21756eafa556359e08","time-ms":3,"cpu-time-ms":0}}
piroor commented 12 years ago

Done. Thanks a lot!