0

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 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 to the Elastic.js query.

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

Many thanks

  • Have you had a look at the elastic.js reference for the range query? http://docs.fullscale.co/elasticjs/ejs.RangeQuery.html – javanna Jul 23 '13 at 11:11
  • Just noticed the question was [cross-posted](https://groups.google.com/d/topic/elasticsearch/AnBuuBLF-8Q/discussion) and you got your answer already, which was to use the RangeQuery and not the QueryString. Cheers – javanna Jul 23 '13 at 11:32
  • @user2607943 Perhaps you could post the answer and accept it. – ramseykhalaf Jul 24 '13 at 12:38

0 Answers0