Skip to content

Support for multi search template #2228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 2, 2016
Merged

Support for multi search template #2228

merged 1 commit into from
Sep 2, 2016

Conversation

gmarz
Copy link
Contributor

@gmarz gmarz commented Aug 30, 2016

@gmarz gmarz added the WIP label Aug 30, 2016
@gmarz gmarz mentioned this pull request Aug 30, 2016
5 tasks
@gmarz gmarz force-pushed the feature/msearch-template branch from 771eaf5 to 2ab31e7 Compare August 31, 2016 22:16
@gmarz gmarz added Feature and removed WIP labels Aug 31, 2016
var withMeta = multiSearch != null
? docsJarray.Zip(multiSearch.Operations, (doc, desc) => new MultiHitTuple { Hit = doc, Descriptor = new KeyValuePair<string, ICovariantSearchRequest>(desc.Key, desc.Value) })
: docsJarray.Zip(multiSearchTemplate.Operations, (doc, desc) => new MultiHitTuple { Hit = doc, Descriptor = new KeyValuePair<string, ICovariantSearchRequest>(desc.Key, desc.Value) });

var originalResolver = serializer.ContractResolver;
Copy link
Contributor

@russcam russcam Sep 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't look originalResolver is used

@russcam
Copy link
Contributor

russcam commented Sep 2, 2016

A few small nitpicks and a question; I tried passing p like

        public IMultiSearchResponse MultiSearchTemplate(IMultiSearchTemplateRequest request)
        {
            return this.Dispatcher.Dispatch<IMultiSearchTemplateRequest, MultiSearchTemplateRequestParameters, MultiSearchResponse>(
                request,
                (p, d) =>
                {
                    var converter = CreateMultiSearchTemplateDeserializer(p);
                    var serializer = this.ConnectionSettings.StatefulSerializer(converter);
                    //var json = serializer.SerializeToBytes(p).Utf8String();
                    var creator = new MultiSearchTemplateCreator((r, s) => serializer.Deserialize<MultiSearchResponse>(s));
                    request.RequestParameters.DeserializationOverride(creator);
                    return this.LowLevelDispatch.MsearchTemplateDispatch<MultiSearchResponse>(p, (object)p);
                }
            );
        }

and the unit and integration tests were happy, but I may be missing something.

LGTM otherwise 👍

@gmarz gmarz force-pushed the feature/msearch-template branch from 2ab31e7 to 42fa133 Compare September 2, 2016 16:13
@gmarz gmarz merged commit 42fa133 into master Sep 2, 2016
@gmarz gmarz deleted the feature/msearch-template branch September 13, 2016 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants