[okfn-labs] Limit ElasticSearch files in query
Rufus Pollock
rufus.pollock at okfn.org
Wed Mar 20 17:24:28 UTC 2013
Hi there,
I don't believe you can do that at the moment but it would super-trivial to
mod the relevant portion of the code:
https://github.com/okfn/recline/blob/master/src/backend.elasticsearch.js#L154
Rufus
On 15 March 2013 17:04, Kubes <pkubat.mlist at freepricealerts.com> wrote:
> All,
>
> Where is the correct place to specify the fields that will be returned for
> a ElasticSearch backend query? I want to limit which fields are returned.
>
> I have tried in the dataset and also the query, but neither seems to work.
>
>
> var fields = new recline.Model.FieldList([ new recline.Model.Field({
> label: "title"}), new recline.Model.Field({ label: "author"}) ]);
>
> var dataset = new recline.Model.Dataset({
> url: 'http://es.domain.com:9200/items/books',
> backend: 'elasticsearch',
> fields: fields
> });
>
>
> Also tried
>
> var query= new recline.Model.Query({
> query: {query_string: {query: 'war and peace'},
> fields: ["title^5","author^3"] },
> size: 10,
> fields: fields
> });
>
>
> Can someone please provide an example?
>
> Thanks!
>
>
> _______________________________________________
> okfn-labs mailing list
> okfn-labs at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/okfn-labs
> Unsubscribe: http://lists.okfn.org/mailman/options/okfn-labs
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/okfn-labs/attachments/20130320/ddbbe3af/attachment-0002.html>
More information about the okfn-labs
mailing list