# Problem with "date query url" and "wildcards with integer"

**URL:** <https://discuss.elastic.co/t/problem-with-date-query-url-and-wildcards-with-integer/9953>\
**Category:** Elasticsearch\
**Created:** [December 5, 2012, 1:20pm UTC](https://discuss.elastic.co/t/problem-with-date-query-url-and-wildcards-with-integer/9953 "2012-12-05T13:20:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jens\_Christian\_Groh](https://avatars.discourse-cdn.com/v4/letter/j/48db29/32.png) [@Jens\_Christian\_Groh](https://discuss.elastic.co/u/Jens_Christian_Groh)\
**Post date:** [December 5, 2012, 1:20pm UTC](https://discuss.elastic.co/t/problem-with-date-query-url-and-wildcards-with-integer/9953/1 "2012-12-05T13:20:16Z")

</div>

Hello,

I have some problemes to build integer and wildcards.

[http://localhost:9200/index/type/\_search?q=Id:1\*](http://localhost:9200/index/type/_search?q=Id:1*)

If this is my query and my object looks like this:

\_source:{  
Id: 126  
}

It should return the object with the Id: 126 or not?

The Second problem I have is to build a query with a date range. Date are  
formated as strings.  
My Object looks like this:

\_source:{  
ManufacturingDate: "2012/10/24 18:18:09"  
}

I thought query should look like this:

http:  
[//localhost:9200/index/type/\_search?q=ManufacturingDate:2010-10-24TO2012-10-24](https://localhost:9200/index/type/_search?q=ManufacturingDate:2010-10-24TO2012-10-24)

or

http:  
[//localhost:9200/index/type/\_search?q=ManufacturingDate:2010-10-24](https://localhost:9200/index/type/_search?q=ManufacturingDate:2010-10-24)_TO2012-10-24_

Does anyone have some hints or suggestions for me?

Thanks in advance.

Chris

--

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [December 5, 2012, 1:52pm UTC](https://discuss.elastic.co/t/problem-with-date-query-url-and-wildcards-with-integer/9953/2 "2012-12-05T13:52:59Z")

</div>

I don't think it will work with integers. Does it make sense?  
With numbers, you probably want to do range queries and not wildcard.  
If you really need wildcard, that means that you consider your field as a String  
and so, you have to send it like: "id" : "126"

For query string syntax, I suggest that you give a look at:  
[http://lucene.apache.org/core/old\_versioned\_docs/versions/2\_9\_1/queryparsersyntax.html](http://lucene.apache.org/core/old_versioned_docs/versions/2_9_1/queryparsersyntax.html)

For example, I suppose that you can run something like:

ManufacturingDate:[20101024 TO 20121224]

But, I recommand to use the QueryDSL:

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

(For example:  
[Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/reference/query-dsl/range-query.html))

Does it help?  
David.

Le 5 décembre 2012 à 14:20, Jens Christian Groh [groh@dtis.eu](mailto:groh@dtis.eu) a écrit :

> Hello,
> 
> I have some problemes to build integer and wildcards.
> 
> http : [//localhost:9200/index/type/\_search?q=Id:1\*](https://localhost:9200/index/type/_search?q=Id:1*)
> 
> If this is my query and my object looks like this:
> 
> \_source :{  
> Id : 126  
> }
> 
> It should return the object with the Id: 126 or not?
> 
> The Second problem I have is to build a query with a date range. Date are  
> formated as strings.  
> My Object looks like this:
> 
> \_source :{  
> ManufacturingDate : "2012/10/24 18:18:09"  
> }
> 
> I thought query should look like this:
> 
> http :  
> [//localhost:9200/index/type/\_search?q=ManufacturingDate:2010-10-24TO2012-10-24](https://localhost:9200/index/type/_search?q=ManufacturingDate:2010-10-24TO2012-10-24)
> 
> or
> 
> http :  
> [//localhost:9200/index/type/\_search?q=ManufacturingDate:2010-10-24](https://localhost:9200/index/type/_search?q=ManufacturingDate:2010-10-24)_TO2012-10-24_
> 
> Does anyone have some hints or suggestions for me?
> 
> Thanks in advance.
> 
> Chris
> 
> --

--  
David Pilato  
[http://www.scrutmydocs.org/](http://www.scrutmydocs.org/)  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:01am UTC](https://discuss.elastic.co/t/problem-with-date-query-url-and-wildcards-with-integer/9953/3 "2017-07-06T03:01:17Z")

</div>


