"from" without "size" does nothing

Hi,

If I execute the following ES returns the correct set of posts, 2000-2024.

#!/bin/bash

curl -XGET 'http://192.168.1.5:9200/_search' -d @- <<EOF | python
-mjson.tool
{
"query" : {
"more_like_this" : {
"fields" : ["content", "title"],
"like_text" : "jetblue blew tire",
"min_term_freq" : 1
},
"from" : 2000,
"size" : 25
}
}
EOF
However, leaving out the "size" (defaulting), always returns posts 0-24,
and ignores the "from" parameter.
#!/bin/bash

curl -XGET 'http://192.168.1.5:9200/_search' -d @- <<EOF | python
-mjson.tool
{
"query" : {
"more_like_this" : {
"fields" : ["content", "title"],
"like_text" : "jetblue blew tire",
"min_term_freq" : 1
},
"from" : 2000
}
}
EOF
Is this expected behavior? I can't find documentation either way.

...Thanks,
...Ken

Strange that it works for you, the "from" and "size" should be set on the
same "query" level:
http://www.elasticsearch.com/docs/elasticsearch/rest_api/search/from_size/.

On Fri, Aug 27, 2010 at 6:43 PM, Kenneth Loafman
kenneth.loafman@gmail.comwrote:

Hi,

If I execute the following ES returns the correct set of posts, 2000-2024.

#!/bin/bash

curl -XGET 'http://192.168.1.5:9200/_search' -d @- <<EOF | python
-mjson.tool
{
"query" : {
"more_like_this" : {
"fields" : ["content", "title"],
"like_text" : "jetblue blew tire",
"min_term_freq" : 1
},
"from" : 2000,
"size" : 25
}
}
EOF
However, leaving out the "size" (defaulting), always returns posts 0-24,
and ignores the "from" parameter.
#!/bin/bash

curl -XGET 'http://192.168.1.5:9200/_search' -d @- <<EOF | python
-mjson.tool
{
"query" : {
"more_like_this" : {
"fields" : ["content", "title"],
"like_text" : "jetblue blew tire",
"min_term_freq" : 1
},
"from" : 2000
}
}
EOF
Is this expected behavior? I can't find documentation either way.

...Thanks,
...Ken

They are on the same query level, just not on the same line. The docs
don't say that 'size' is required when 'from' is supplied.

Shay Banon wrote:

Strange that it works for you, the "from" and "size" should be set on
the same "query"
level: http://www.elasticsearch.com/docs/elasticsearch/rest_api/search/from_size/.

On Fri, Aug 27, 2010 at 6:43 PM, Kenneth Loafman
<kenneth.loafman@gmail.com mailto:kenneth.loafman@gmail.com> wrote:

Hi,

If I execute the following ES returns the correct set of posts,
2000-2024.
> #!/bin/bash
>
> curl -XGET 'http://192.168.1.5:9200/_search' -d @- <<EOF | python
> -mjson.tool
> {
>     "query" : {
>         "more_like_this" : {
>             "fields" : ["content", "title"],
>             "like_text" : "jetblue blew tire",
>             "min_term_freq" : 1
>         },
>         "from" : 2000,
>         "size" : 25
>     }
> }
> EOF
However, leaving out the "size" (defaulting), always returns posts 0-24,
and ignores the "from" parameter.
> #!/bin/bash
>
> curl -XGET 'http://192.168.1.5:9200/_search' -d @- <<EOF | python
> -mjson.tool
> {
>     "query" : {
>         "more_like_this" : {
>             "fields" : ["content", "title"],
>             "like_text" : "jetblue blew tire",
>             "min_term_freq" : 1
>         },
>         "from" : 2000
>     }
> }
> EOF
Is this expected behavior?  I can't find documentation either way.

...Thanks,
...Ken

Here is how it should look like: gist:553660 · GitHub.

On Fri, Aug 27, 2010 at 7:12 PM, Kenneth Loafman
kenneth.loafman@gmail.comwrote:

They are on the same query level, just not on the same line. The docs
don't say that 'size' is required when 'from' is supplied.

Shay Banon wrote:

Strange that it works for you, the "from" and "size" should be set on
the same "query"
level:
http://www.elasticsearch.com/docs/elasticsearch/rest_api/search/from_size/
.

On Fri, Aug 27, 2010 at 6:43 PM, Kenneth Loafman
<kenneth.loafman@gmail.com mailto:kenneth.loafman@gmail.com> wrote:

Hi,

If I execute the following ES returns the correct set of posts,
2000-2024.
> #!/bin/bash
>
> curl -XGET 'http://192.168.1.5:9200/_search' -d @- <<EOF | python
> -mjson.tool
> {
>     "query" : {
>         "more_like_this" : {
>             "fields" : ["content", "title"],
>             "like_text" : "jetblue blew tire",
>             "min_term_freq" : 1
>         },
>         "from" : 2000,
>         "size" : 25
>     }
> }
> EOF
However, leaving out the "size" (defaulting), always returns posts

0-24,

and ignores the "from" parameter.
> #!/bin/bash
>
> curl -XGET 'http://192.168.1.5:9200/_search' -d @- <<EOF | python
> -mjson.tool
> {
>     "query" : {
>         "more_like_this" : {
>             "fields" : ["content", "title"],
>             "like_text" : "jetblue blew tire",
>             "min_term_freq" : 1
>         },
>         "from" : 2000
>     }
> }
> EOF
Is this expected behavior?  I can't find documentation either way.

...Thanks,
...Ken

OK, that did it. Thanks!

Shay Banon wrote:

Here is how it should look like: gist:553660 · GitHub.

On Fri, Aug 27, 2010 at 7:12 PM, Kenneth Loafman
<kenneth.loafman@gmail.com mailto:kenneth.loafman@gmail.com> wrote:

They are on the same query level, just not on the same line.  The docs
don't say that 'size' is required when 'from' is supplied.

Shay Banon wrote:
> Strange that it works for you, the "from" and "size" should be set on
> the same "query"
> level:
http://www.elasticsearch.com/docs/elasticsearch/rest_api/search/from_size/.
>
> On Fri, Aug 27, 2010 at 6:43 PM, Kenneth Loafman
> <kenneth.loafman@gmail.com <mailto:kenneth.loafman@gmail.com>
<mailto:kenneth.loafman@gmail.com
<mailto:kenneth.loafman@gmail.com>>> wrote:
>
>     Hi,
>
>     If I execute the following ES returns the correct set of posts,
>     2000-2024.
>     > #!/bin/bash
>     >
>     > curl -XGET 'http://192.168.1.5:9200/_search' -d @- <<EOF |
python
>     > -mjson.tool
>     > {
>     >     "query" : {
>     >         "more_like_this" : {
>     >             "fields" : ["content", "title"],
>     >             "like_text" : "jetblue blew tire",
>     >             "min_term_freq" : 1
>     >         },
>     >         "from" : 2000,
>     >         "size" : 25
>     >     }
>     > }
>     > EOF
>     However, leaving out the "size" (defaulting), always returns
posts 0-24,
>     and ignores the "from" parameter.
>     > #!/bin/bash
>     >
>     > curl -XGET 'http://192.168.1.5:9200/_search' -d @- <<EOF |
python
>     > -mjson.tool
>     > {
>     >     "query" : {
>     >         "more_like_this" : {
>     >             "fields" : ["content", "title"],
>     >             "like_text" : "jetblue blew tire",
>     >             "min_term_freq" : 1
>     >         },
>     >         "from" : 2000
>     >     }
>     > }
>     > EOF
>     Is this expected behavior?  I can't find documentation either way.
>
>     ...Thanks,
>     ...Ken
>
>