Elasticsearch and Elastic.js

Hi,

i am currently using Elastic.js (Angular.js integration) to query
Elasticsearch.

I have an Elasticsearch query that is as follows:

{
"query" : {
"range" : {
"created_at" : {
"from" : "2013-07-21T03:55:32.000"
}
}
}, "facets" : {
"tag" : {
"terms" : {
"field" : "hashtag.text",
"size" : 10
}
}
}
}

I am have a query that works without the data range filter, the query using
Angular and Elastic.js is :

.query(ejs.QueryStringQuery($rootScope.globalVariable || '*'))

            .facet(
                ejs.TermsFacet('tags')
          
                    .field('hashtag.text')

                    .size(50))

            .doSearch();

I have tried many combinations to add the date range filter.

Can anyone please give some ideas/clues on how I can do this?

Many thanks

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Use RangeQuery (http://docs.fullscale.co/elasticjs/ejs.RangeQuery.html) not
a QueryStringQuery.

.query(
ejs.RangeQuery('created_at').from('2013-07-21T03:55:32.000')
)

.facet(
ejs.TermsFacet('tags')
.field('hashtag.text')
.size(50)

)

.doSearch();

WIth elastic.js you piece together queries just like you would using the
REST api.

Thanks,
Matt Weber

On Mon, Jul 22, 2013 at 11:20 AM, Jay S gplusacc0808@gmail.com wrote:

Hi,

i am currently using Elastic.js (Angular.js integration) to query
Elasticsearch.

I have an Elasticsearch query that is as follows:

{
"query" : {
"range" : {
"created_at" : {
"from" : "2013-07-21T03:55:32.000"
}
}
}, "facets" : {
"tag" : {
"terms" : {
"field" : "hashtag.text",
"size" : 10
}
}
}
}

I am have a query that works without the data range filter, the query
using Angular and Elastic.js is :

.query(ejs.QueryStringQuery($rootScope.globalVariable || '*'))

            .facet(
                ejs.TermsFacet('tags')

                    .field('hashtag.text')

                    .size(50))

            .doSearch();

I have tried many combinations to add the date range filter.

Can anyone please give some ideas/clues on how I can do this?

Many thanks

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

BTW, if you want to keep your query string and filter by the created date
you would wrap it in a filtered query like this:

.query(
ejs.FilteredQuery(
ejs.QueryStringQuery($rootScope.globalVariable || '*'),
ejs.RangeFilter('created_at').from('2013-07-21T03:55:32.000')
)
)

.facet(
ejs.TermsFacet('tags')
.field('hashtag.text')
.size(50)
)

.doSearch();

Hope this helped.

Thanks,
Matt Weber

On Mon, Jul 22, 2013 at 11:32 AM, Matt Weber matt.weber@gmail.com wrote:

Use RangeQuery (http://docs.fullscale.co/elasticjs/ejs.RangeQuery.html) not
a QueryStringQuery.

.query(
ejs.RangeQuery('created_at').from('2013-07-21T03:55:32.000')
)

.facet(
ejs.TermsFacet('tags')
.field('hashtag.text')
.size(50)

)

.doSearch();

WIth elastic.js you piece together queries just like you would using the
REST api.

Thanks,
Matt Weber

On Mon, Jul 22, 2013 at 11:20 AM, Jay S gplusacc0808@gmail.com wrote:

Hi,

i am currently using Elastic.js (Angular.js integration) to query
Elasticsearch.

I have an Elasticsearch query that is as follows:

{
"query" : {
"range" : {
"created_at" : {
"from" : "2013-07-21T03:55:32.000"
}
}
}, "facets" : {
"tag" : {
"terms" : {
"field" : "hashtag.text",
"size" : 10
}
}
}
}

I am have a query that works without the data range filter, the query
using Angular and Elastic.js is :

.query(ejs.QueryStringQuery($rootScope.globalVariable || '*'))

            .facet(
                ejs.TermsFacet('tags')

                    .field('hashtag.text')

                    .size(50))

            .doSearch();

I have tried many combinations to add the date range filter.

Can anyone please give some ideas/clues on how I can do this?

Many thanks

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Matt, it worked.

Thank you so much for your help. It is much appreciated.

Jay

On Monday, 22 July 2013 20:38:34 UTC+2, Matt Weber wrote:

BTW, if you want to keep your query string and filter by the created date
you would wrap it in a filtered query like this:

.query(
ejs.FilteredQuery(
ejs.QueryStringQuery($rootScope.globalVariable || '*'),
ejs.RangeFilter('created_at').from('2013-07-21T03:55:32.000')
)
)

.facet(
ejs.TermsFacet('tags')
.field('hashtag.text')
.size(50)
)

.doSearch();

Hope this helped.

Thanks,
Matt Weber

On Mon, Jul 22, 2013 at 11:32 AM, Matt Weber <matt....@gmail.com<javascript:>

wrote:

Use RangeQuery (http://docs.fullscale.co/elasticjs/ejs.RangeQuery.html) not
a QueryStringQuery.

.query(
ejs.RangeQuery('created_at').from('2013-07-21T03:55:32.000')
)

.facet(
ejs.TermsFacet('tags')
.field('hashtag.text')
.size(50)

)

.doSearch();

WIth elastic.js you piece together queries just like you would using the
REST api.

Thanks,
Matt Weber

On Mon, Jul 22, 2013 at 11:20 AM, Jay S <gplusa...@gmail.com<javascript:>

wrote:

Hi,

i am currently using Elastic.js (Angular.js integration) to query
Elasticsearch.

I have an Elasticsearch query that is as follows:

{
"query" : {
"range" : {
"created_at" : {
"from" : "2013-07-21T03:55:32.000"
}
}
}, "facets" : {
"tag" : {
"terms" : {
"field" : "hashtag.text",
"size" : 10
}
}
}
}

I am have a query that works without the data range filter, the query
using Angular and Elastic.js is :

.query(ejs.QueryStringQuery($rootScope.globalVariable || '*'))

            .facet(
                ejs.TermsFacet('tags')
          
                    .field('hashtag.text')

                    .size(50))

            .doSearch();

I have tried many combinations to add the date range filter.

Can anyone please give some ideas/clues on how I can do this?

Many thanks

--
You received this message because you are subscribed to the Google
Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to elasticsearc...@googlegroups.com <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.