Usage of colons in search


(Robin Verlangen) #1

Hi there,

We found out that when we use colons ":" in our search, that it seems to
break? We searched for a time, like "09:22:50" and the request kept
pending. Is this a common issue, or did we do something wrong?

Best regards,

Robin Verlangen
Software engineer
*
*
W http://www.robinverlangen.nl
E robin@us2.nl

Disclaimer: The information contained in this message and attachments is
intended solely for the attention and use of the named addressee and may be
confidential. If you are not the intended recipient, you are reminded that
the information remains the property of the sender. You must not use,
disclose, distribute, copy, print or rely on this e-mail. If you have
received this message in error, please contact the sender immediately and
irrevocably delete this message and any copies.

--


(Clinton Gormley) #2

Hi Robin

We found out that when we use colons ":" in our search, that it seems
to break? We searched for a time, like "09:22:50" and the request kept
pending. Is this a common issue, or did we do something wrong?

Impossible to say without seeing what you actually did. See
http://www.elasticsearch.org/help for advice about how to present the
problem

clint

Best regards,

Robin Verlangen
Software engineer

W http://www.robinverlangen.nl
E robin@us2.nl

Disclaimer: The information contained in this message and attachments
is intended solely for the attention and use of the named addressee
and may be confidential. If you are not the intended recipient, you
are reminded that the information remains the property of the sender.
You must not use, disclose, distribute, copy, print or rely on this
e-mail. If you have received this message in error, please contact the
sender immediately and irrevocably delete this message and any copies.

--

--


(Robin Verlangen) #3

Hi Clinton,

I don't think such a complex thing is necessary, just these 3 seps:

  1. Create an index
  2. Insert "[DEBUG] Fri Sep 21 19:38:58 CEST 2012"
  3. Search for " Fri Sep 21 19:38:58 CEST 2012" (using a browser on
    localhost:
    http://localhost:9200/2012-09-21/_search?q=Fri%20Sep%2021%2019:38:58 )

Thank you for your time!

Best regards,

Robin Verlangen
Software engineer
*
*
W http://www.robinverlangen.nl
E robin@us2.nl

Disclaimer: The information contained in this message and attachments is
intended solely for the attention and use of the named addressee and may be
confidential. If you are not the intended recipient, you are reminded that
the information remains the property of the sender. You must not use,
disclose, distribute, copy, print or rely on this e-mail. If you have
received this message in error, please contact the sender immediately and
irrevocably delete this message and any copies.

2012/9/21 Clinton Gormley clint@traveljury.com

Hi Robin

We found out that when we use colons ":" in our search, that it seems
to break? We searched for a time, like "09:22:50" and the request kept
pending. Is this a common issue, or did we do something wrong?

Impossible to say without seeing what you actually did. See
http://www.elasticsearch.org/help for advice about how to present the
problem

clint

Best regards,

Robin Verlangen
Software engineer

W http://www.robinverlangen.nl
E robin@us2.nl

Disclaimer: The information contained in this message and attachments
is intended solely for the attention and use of the named addressee
and may be confidential. If you are not the intended recipient, you
are reminded that the information remains the property of the sender.
You must not use, disclose, distribute, copy, print or rely on this
e-mail. If you have received this message in error, please contact the
sender immediately and irrevocably delete this message and any copies.

--

--

--


(Clinton Gormley) #4

Hi Robin

I don't think such a complex thing is necessary, just these 3 seps:

All I was asking for was a recreation, which you have provided below :slight_smile:
However, for anything more complex, I'd want to be able to copy and
paste it in order to test it out.

  1. Create an index
  2. Insert "[DEBUG] Fri Sep 21 19:38:58 CEST 2012"
  3. Search for " Fri Sep 21 19:38:58 CEST 2012" (using a browser on
    localhost: http://localhost:9200/2012-09-21/_search?q=Fri%20Sep%2021%
    2019:38:58 )

The ?q= search corresponds to the query string query
http://www.elasticsearch.org/guide/reference/query-dsl/query-string-query.html
which uses the Lucene query parser syntax
http://lucene.apache.org/core/3_6_0/queryparsersyntax.html

so your search string is being parsed according to the syntax described
above. Colons are used to introduce field names. But FOO:FOO:FOO is a
syntax error, so you should have received an error in response from ES.

I get:
ParseException[Cannot parse 'Fri Sep 21 19:38:58': Encountered " ":" ": ""

clint

--


(Robin Verlangen) #5

Hmm, my page just hangs. But I understand the problem with the colons now.
Thank you for pointing that out :slight_smile: I'll just have to quote them.

Best regards,

Robin Verlangen
Software engineer
*
*
W http://www.robinverlangen.nl
E robin@us2.nl

Disclaimer: The information contained in this message and attachments is
intended solely for the attention and use of the named addressee and may be
confidential. If you are not the intended recipient, you are reminded that
the information remains the property of the sender. You must not use,
disclose, distribute, copy, print or rely on this e-mail. If you have
received this message in error, please contact the sender immediately and
irrevocably delete this message and any copies.

2012/9/21 Clinton Gormley clint@traveljury.com

Hi Robin

I don't think such a complex thing is necessary, just these 3 seps:

All I was asking for was a recreation, which you have provided below :slight_smile:
However, for anything more complex, I'd want to be able to copy and
paste it in order to test it out.

  1. Create an index
  2. Insert "[DEBUG] Fri Sep 21 19:38:58 CEST 2012"
  3. Search for " Fri Sep 21 19:38:58 CEST 2012" (using a browser on
    localhost: http://localhost:9200/2012-09-21/_search?q=Fri%20Sep%2021%
    2019:38:58 )

The ?q= search corresponds to the query string query

http://www.elasticsearch.org/guide/reference/query-dsl/query-string-query.html
which uses the Lucene query parser syntax
http://lucene.apache.org/core/3_6_0/queryparsersyntax.html

so your search string is being parsed according to the syntax described
above. Colons are used to introduce field names. But FOO:FOO:FOO is a
syntax error, so you should have received an error in response from ES.

I get:
ParseException[Cannot parse 'Fri Sep 21 19:38:58': Encountered " ":" ": ""

clint

--

--


(Clinton Gormley) #6

On Fri, 2012-09-21 at 19:52 +0200, Robin Verlangen wrote:

Hmm, my page just hangs. But I understand the problem with the colons
now. Thank you for pointing that out :slight_smile: I'll just have to quote them.

Or use the query DSL instead

It's a lot easier to have malformed query-string queries than with the
DSL

clint

Best regards,

Robin Verlangen
Software engineer

W http://www.robinverlangen.nl
E robin@us2.nl

Disclaimer: The information contained in this message and attachments
is intended solely for the attention and use of the named addressee
and may be confidential. If you are not the intended recipient, you
are reminded that the information remains the property of the sender.
You must not use, disclose, distribute, copy, print or rely on this
e-mail. If you have received this message in error, please contact the
sender immediately and irrevocably delete this message and any copies.

2012/9/21 Clinton Gormley clint@traveljury.com
Hi Robin
>
>
> I don't think such a complex thing is necessary, just these
3 seps:

    All I was asking for was a recreation, which you have provided
    below :)
    However, for anything more complex, I'd want to be able to
    copy and
    paste it in order to test it out.
    
    > 1. Create an index
    > 2. Insert "[DEBUG] Fri Sep 21 19:38:58 CEST 2012"
    > 3. Search for " Fri Sep 21 19:38:58 CEST 2012" (using a
    browser on
    > localhost: http://localhost:9200/2012-09-21/_search?q=Fri%
    20Sep%2021%
    > 2019:38:58 )
    
    
    The ?q= search corresponds to the query string query
    http://www.elasticsearch.org/guide/reference/query-dsl/query-string-query.html
    which uses the Lucene query parser syntax
    http://lucene.apache.org/core/3_6_0/queryparsersyntax.html
    
    so your search string is being parsed according to the syntax
    described
    above.  Colons are used to introduce field names.  But
    FOO:FOO:FOO is a
    syntax error, so you should have received an error in response
    from ES.
    
    I get:
    ParseException[Cannot parse 'Fri Sep 21 19:38:58': Encountered
    " ":" ": ""
    
    clint
    
    
    
    --

--

--


(Robin Verlangen) #7

We will in the future as we're going to write our own interface on ES and
perform many post-processing steps. This was just for some manual testing
which caused me a tiny headache... :slight_smile:

Best regards,

Robin Verlangen
Software engineer
*
*
W http://www.robinverlangen.nl
E robin@us2.nl

Disclaimer: The information contained in this message and attachments is
intended solely for the attention and use of the named addressee and may be
confidential. If you are not the intended recipient, you are reminded that
the information remains the property of the sender. You must not use,
disclose, distribute, copy, print or rely on this e-mail. If you have
received this message in error, please contact the sender immediately and
irrevocably delete this message and any copies.

2012/9/21 Clinton Gormley clint@traveljury.com

On Fri, 2012-09-21 at 19:52 +0200, Robin Verlangen wrote:

Hmm, my page just hangs. But I understand the problem with the colons
now. Thank you for pointing that out :slight_smile: I'll just have to quote them.

Or use the query DSL instead

It's a lot easier to have malformed query-string queries than with the
DSL

clint

Best regards,

Robin Verlangen
Software engineer

W http://www.robinverlangen.nl
E robin@us2.nl

Disclaimer: The information contained in this message and attachments
is intended solely for the attention and use of the named addressee
and may be confidential. If you are not the intended recipient, you
are reminded that the information remains the property of the sender.
You must not use, disclose, distribute, copy, print or rely on this
e-mail. If you have received this message in error, please contact the
sender immediately and irrevocably delete this message and any copies.

2012/9/21 Clinton Gormley clint@traveljury.com
Hi Robin
>
>
> I don't think such a complex thing is necessary, just these
3 seps:

    All I was asking for was a recreation, which you have provided
    below :)
    However, for anything more complex, I'd want to be able to
    copy and
    paste it in order to test it out.

    > 1. Create an index
    > 2. Insert "[DEBUG] Fri Sep 21 19:38:58 CEST 2012"
    > 3. Search for " Fri Sep 21 19:38:58 CEST 2012" (using a
    browser on
    > localhost: http://localhost:9200/2012-09-21/_search?q=Fri%
    20Sep%2021%
    > 2019:38:58 )


    The ?q= search corresponds to the query string query

http://www.elasticsearch.org/guide/reference/query-dsl/query-string-query.html

    which uses the Lucene query parser syntax
    http://lucene.apache.org/core/3_6_0/queryparsersyntax.html

    so your search string is being parsed according to the syntax
    described
    above.  Colons are used to introduce field names.  But
    FOO:FOO:FOO is a
    syntax error, so you should have received an error in response
    from ES.

    I get:
    ParseException[Cannot parse 'Fri Sep 21 19:38:58': Encountered
    " ":" ": ""

    clint



    --

--

--

--


(system) #8