List all entries in an index + type


(Franz Allan Valencia See) #1

Currently, I can search for entries in an index + type. But if I wan to list
it and paginate through it, how can I do that with ElasticSearch?

Thanks,

Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see


(Samuel Doyle) #2

If you are using Java you can use from and size on the builder.

http://www.elasticsearch.com/docs/elasticsearch/java_api/search/

On Sun, Jul 11, 2010 at 8:06 PM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Currently, I can search for entries in an index + type. But if I wan to
list it and paginate through it, how can I do that with ElasticSearch?

Thanks,

Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see


(Shay Banon) #3

From and size are exposed in the REST API as well. You can use scroll
request as well, but note that scroll should not be used to execute many
concurrent search requests.

-shay.banon

On Mon, Jul 12, 2010 at 8:21 AM, Samuel Doyle samueldoyle@gmail.com wrote:

If you are using Java you can use from and size on the builder.

http://www.elasticsearch.com/docs/elasticsearch/java_api/search/

On Sun, Jul 11, 2010 at 8:06 PM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Currently, I can search for entries in an index + type. But if I wan to
list it and paginate through it, how can I do that with ElasticSearch?

Thanks,

Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see


(Franz Allan Valencia See) #4

Pardon, but how exactly?

I'm getting this:
franz@see:~$ curl -XGET http://localhost:9200/myindex/myType/_search -d '

{
"from" : 0, "size" : 10
}
'
{"error":"SearchPhaseExecutionException[Failed to execute [query] total
failure; shardFailures
{[abaf7629-100b-4740-a716-56823787a3b9][application][0]:
SearchParseException[[application][0]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][4]:
SearchParseException[[application][4]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][3]:
SearchParseException[[application][3]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][2]:
SearchParseException[[application][2]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][1]:
SearchParseException[[application][1]: query[null],from[0],size[10]: Parse
Failure [No query specified in search request]]}]"}

I didn't enter a query because I wanted to see all contents of the
myindex/myType.

Thanks,

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

On Tue, Jul 13, 2010 at 1:59 AM, Shay Banon shay.banon@elasticsearch.comwrote:

From and size are exposed in the REST API as well. You can use scroll
request as well, but note that scroll should not be used to execute many
concurrent search requests.

-shay.banon

On Mon, Jul 12, 2010 at 8:21 AM, Samuel Doyle samueldoyle@gmail.comwrote:

If you are using Java you can use from and size on the builder.

http://www.elasticsearch.com/docs/elasticsearch/java_api/search/

On Sun, Jul 11, 2010 at 8:06 PM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Currently, I can search for entries in an index + type. But if I wan to
list it and paginate through it, how can I do that with ElasticSearch?

Thanks,

Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see


(Lukáš Vlček) #5

Hi,

if I am not mistaken then you are missing a "query" portion in your JSON.

curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"query" : {
"from" : 0, "size" : 10
}
}
'

Regards,
Lukas

On Fri, Jul 16, 2010 at 9:24 AM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Pardon, but how exactly?

I'm getting this:
franz@see:~$ curl -XGET http://localhost:9200/myindex/myType/_search -d '

{
"from" : 0, "size" : 10
}
'
{"error":"SearchPhaseExecutionException[Failed to execute [query] total
failure; shardFailures
{[abaf7629-100b-4740-a716-56823787a3b9][application][0]:
SearchParseException[[application][0]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][4]:
SearchParseException[[application][4]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][3]:
SearchParseException[[application][3]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][2]:
SearchParseException[[application][2]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][1]:
SearchParseException[[application][1]: query[null],from[0],size[10]: Parse
Failure [No query specified in search request]]}]"}

I didn't enter a query because I wanted to see all contents of the
myindex/myType.

Thanks,

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

On Tue, Jul 13, 2010 at 1:59 AM, Shay Banon shay.banon@elasticsearch.comwrote:

From and size are exposed in the REST API as well. You can use scroll
request as well, but note that scroll should not be used to execute many
concurrent search requests.

-shay.banon

On Mon, Jul 12, 2010 at 8:21 AM, Samuel Doyle samueldoyle@gmail.comwrote:

If you are using Java you can use from and size on the builder.

http://www.elasticsearch.com/docs/elasticsearch/java_api/search/

On Sun, Jul 11, 2010 at 8:06 PM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Currently, I can search for entries in an index + type. But if I wan to
list it and paginate through it, how can I do that with ElasticSearch?

Thanks,

Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see


(Franz Allan Valencia See) #6

Thanks. But still nothing...

franz@see:~$ curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"query" : { "from" : 0, "size" : 10 }
}
'
{"error":"SearchPhaseExecutionException[Failed to execute [query] total
failure; shardFailures {[abaf7629-100b-4740-a716-56823787a3b9][myindex][4]:
SearchParseException[[myindex][4]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][2]:
SearchParseException[[myindex][2]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][0]:
SearchParseException[[myindex][0]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][1]:
SearchParseException[[myindex][1]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][3]:
SearchParseException[[myindex][3]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]]; }]"}

On Fri, Jul 16, 2010 at 3:31 PM, Lukáš Vlček lukas.vlcek@gmail.com wrote:

Hi,

if I am not mistaken then you are missing a "query" portion in your JSON.

curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"query" : {
"from" : 0, "size" : 10
}
}
'

Regards,
Lukas

On Fri, Jul 16, 2010 at 9:24 AM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Pardon, but how exactly?

I'm getting this:
franz@see:~$ curl -XGET http://localhost:9200/myindex/myType/_search -d '

{
"from" : 0, "size" : 10
}
'
{"error":"SearchPhaseExecutionException[Failed to execute [query] total
failure; shardFailures
{[abaf7629-100b-4740-a716-56823787a3b9][application][0]:
SearchParseException[[application][0]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][4]:
SearchParseException[[application][4]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][3]:
SearchParseException[[application][3]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][2]:
SearchParseException[[application][2]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][1]:
SearchParseException[[application][1]: query[null],from[0],size[10]: Parse
Failure [No query specified in search request]]}]"}

I didn't enter a query because I wanted to see all contents of the
myindex/myType.

Thanks,

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

On Tue, Jul 13, 2010 at 1:59 AM, Shay Banon <shay.banon@elasticsearch.com

wrote:

From and size are exposed in the REST API as well. You can use scroll
request as well, but note that scroll should not be used to execute many
concurrent search requests.

-shay.banon

On Mon, Jul 12, 2010 at 8:21 AM, Samuel Doyle samueldoyle@gmail.comwrote:

If you are using Java you can use from and size on the builder.

http://www.elasticsearch.com/docs/elasticsearch/java_api/search/

On Sun, Jul 11, 2010 at 8:06 PM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Currently, I can search for entries in an index + type. But if I wan to
list it and paginate through it, how can I do that with ElasticSearch?

Thanks,

Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see


(Lukáš Vlček) #7

Sorry I double checked with the docs and I think I gave you wrong hint.

Lukas

On Fri, Jul 16, 2010 at 9:34 AM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Thanks. But still nothing...

franz@see:~$ curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"query" : { "from" : 0, "size" : 10 }
}
'
{"error":"SearchPhaseExecutionException[Failed to execute [query] total
failure; shardFailures {[abaf7629-100b-4740-a716-56823787a3b9][myindex][4]:
SearchParseException[[myindex][4]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][2]:
SearchParseException[[myindex][2]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][0]:
SearchParseException[[myindex][0]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][1]:
SearchParseException[[myindex][1]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][3]:
SearchParseException[[myindex][3]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]]; }]"}

On Fri, Jul 16, 2010 at 3:31 PM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

Hi,

if I am not mistaken then you are missing a "query" portion in your JSON.

curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"query" : {
"from" : 0, "size" : 10
}
}
'

Regards,
Lukas

On Fri, Jul 16, 2010 at 9:24 AM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Pardon, but how exactly?

I'm getting this:
franz@see:~$ curl -XGET http://localhost:9200/myindex/myType/_search -d
'

{
"from" : 0, "size" : 10
}
'
{"error":"SearchPhaseExecutionException[Failed to execute [query] total
failure; shardFailures
{[abaf7629-100b-4740-a716-56823787a3b9][application][0]:
SearchParseException[[application][0]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][4]:
SearchParseException[[application][4]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][3]:
SearchParseException[[application][3]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][2]:
SearchParseException[[application][2]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][1]:
SearchParseException[[application][1]: query[null],from[0],size[10]: Parse
Failure [No query specified in search request]]}]"}

I didn't enter a query because I wanted to see all contents of the
myindex/myType.

Thanks,

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

On Tue, Jul 13, 2010 at 1:59 AM, Shay Banon <
shay.banon@elasticsearch.com> wrote:

From and size are exposed in the REST API as well. You can use scroll
request as well, but note that scroll should not be used to execute many
concurrent search requests.

-shay.banon

On Mon, Jul 12, 2010 at 8:21 AM, Samuel Doyle samueldoyle@gmail.comwrote:

If you are using Java you can use from and size on the builder.

http://www.elasticsearch.com/docs/elasticsearch/java_api/search/

On Sun, Jul 11, 2010 at 8:06 PM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Currently, I can search for entries in an index + type. But if I wan
to list it and paginate through it, how can I do that with ElasticSearch?

Thanks,

Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see


(Lukáš Vlček) #8

So if I understand correctly you just want to paginate on documents stored
in ES without specifying a query, meaning without specifying the order of
documents. (As the query is what determines relevancy and order of
documents). Do you think you can elaborate more on what your goal is?

Lukas

On Fri, Jul 16, 2010 at 9:39 AM, Lukáš Vlček lukas.vlcek@gmail.com wrote:

Sorry I double checked with the docs and I think I gave you wrong hint.

Lukas

On Fri, Jul 16, 2010 at 9:34 AM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Thanks. But still nothing...

franz@see:~$ curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"query" : { "from" : 0, "size" : 10 }
}
'
{"error":"SearchPhaseExecutionException[Failed to execute [query] total
failure; shardFailures {[abaf7629-100b-4740-a716-56823787a3b9][myindex][4]:
SearchParseException[[myindex][4]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][2]:
SearchParseException[[myindex][2]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][0]:
SearchParseException[[myindex][0]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][1]:
SearchParseException[[myindex][1]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][3]:
SearchParseException[[myindex][3]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]]; }]"}

On Fri, Jul 16, 2010 at 3:31 PM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

Hi,

if I am not mistaken then you are missing a "query" portion in your JSON.

curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"query" : {
"from" : 0, "size" : 10
}
}
'

Regards,
Lukas

On Fri, Jul 16, 2010 at 9:24 AM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Pardon, but how exactly?

I'm getting this:
franz@see:~$ curl -XGET http://localhost:9200/myindex/myType/_search -d
'

{
"from" : 0, "size" : 10
}
'
{"error":"SearchPhaseExecutionException[Failed to execute [query] total
failure; shardFailures
{[abaf7629-100b-4740-a716-56823787a3b9][application][0]:
SearchParseException[[application][0]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][4]:
SearchParseException[[application][4]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][3]:
SearchParseException[[application][3]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][2]:
SearchParseException[[application][2]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][1]:
SearchParseException[[application][1]: query[null],from[0],size[10]: Parse
Failure [No query specified in search request]]}]"}

I didn't enter a query because I wanted to see all contents of the
myindex/myType.

Thanks,

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

On Tue, Jul 13, 2010 at 1:59 AM, Shay Banon <
shay.banon@elasticsearch.com> wrote:

From and size are exposed in the REST API as well. You can use scroll
request as well, but note that scroll should not be used to execute many
concurrent search requests.

-shay.banon

On Mon, Jul 12, 2010 at 8:21 AM, Samuel Doyle samueldoyle@gmail.comwrote:

If you are using Java you can use from and size on the builder.

http://www.elasticsearch.com/docs/elasticsearch/java_api/search/

On Sun, Jul 11, 2010 at 8:06 PM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Currently, I can search for entries in an index + type. But if I wan
to list it and paginate through it, how can I do that with ElasticSearch?

Thanks,

Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see


(Lukáš Vlček) #9

May be you can try use Match All Query (
http://www.elasticsearch.com/docs/elasticsearch/rest_api/query_dsl/match_all_query/
)

curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"match_all" : {},
"from" : 0, "size" : 10
}
'

Lukas

On Fri, Jul 16, 2010 at 9:46 AM, Lukáš Vlček lukas.vlcek@gmail.com wrote:

So if I understand correctly you just want to paginate on documents stored
in ES without specifying a query, meaning without specifying the order of
documents. (As the query is what determines relevancy and order of
documents). Do you think you can elaborate more on what your goal is?

Lukas

On Fri, Jul 16, 2010 at 9:39 AM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

Sorry I double checked with the docs and I think I gave you wrong hint.

Lukas

On Fri, Jul 16, 2010 at 9:34 AM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Thanks. But still nothing...

franz@see:~$ curl -XGET http://localhost:9200/myindex/myType/_search -d
'
{
"query" : { "from" : 0, "size" : 10 }
}
'
{"error":"SearchPhaseExecutionException[Failed to execute [query] total
failure; shardFailures {[abaf7629-100b-4740-a716-56823787a3b9][myindex][4]:
SearchParseException[[myindex][4]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][2]:
SearchParseException[[myindex][2]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][0]:
SearchParseException[[myindex][0]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][1]:
SearchParseException[[myindex][1]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][3]:
SearchParseException[[myindex][3]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]]; }]"}

On Fri, Jul 16, 2010 at 3:31 PM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

Hi,

if I am not mistaken then you are missing a "query" portion in your
JSON.

curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"query" : {
"from" : 0, "size" : 10
}
}
'

Regards,
Lukas

On Fri, Jul 16, 2010 at 9:24 AM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Pardon, but how exactly?

I'm getting this:
franz@see:~$ curl -XGET http://localhost:9200/myindex/myType/_search-d '

{
"from" : 0, "size" : 10
}
'
{"error":"SearchPhaseExecutionException[Failed to execute [query] total
failure; shardFailures
{[abaf7629-100b-4740-a716-56823787a3b9][application][0]:
SearchParseException[[application][0]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][4]:
SearchParseException[[application][4]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][3]:
SearchParseException[[application][3]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][2]:
SearchParseException[[application][2]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][1]:
SearchParseException[[application][1]: query[null],from[0],size[10]: Parse
Failure [No query specified in search request]]}]"}

I didn't enter a query because I wanted to see all contents of the
myindex/myType.

Thanks,

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

On Tue, Jul 13, 2010 at 1:59 AM, Shay Banon <
shay.banon@elasticsearch.com> wrote:

From and size are exposed in the REST API as well. You can use scroll
request as well, but note that scroll should not be used to execute many
concurrent search requests.

-shay.banon

On Mon, Jul 12, 2010 at 8:21 AM, Samuel Doyle samueldoyle@gmail.comwrote:

If you are using Java you can use from and size on the builder.

http://www.elasticsearch.com/docs/elasticsearch/java_api/search/

On Sun, Jul 11, 2010 at 8:06 PM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Currently, I can search for entries in an index + type. But if I wan
to list it and paginate through it, how can I do that with ElasticSearch?

Thanks,

Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see


(Lukáš Vlček) #10

Here is the query you can use (finally I tested this on my system and it
works!). I was missing the "query" portion of JSON in my previous post.

curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"query" : { "match_all" : {}},
"from" : 0, "size" : 10
}
'
Regards,
Lukas

On Fri, Jul 16, 2010 at 9:53 AM, Lukáš Vlček lukas.vlcek@gmail.com wrote:

May be you can try use Match All Query (
http://www.elasticsearch.com/docs/elasticsearch/rest_api/query_dsl/match_all_query/
)

curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"match_all" : {},
"from" : 0, "size" : 10
}
'

Lukas

On Fri, Jul 16, 2010 at 9:46 AM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

So if I understand correctly you just want to paginate on documents stored
in ES without specifying a query, meaning without specifying the order of
documents. (As the query is what determines relevancy and order of
documents). Do you think you can elaborate more on what your goal is?

Lukas

On Fri, Jul 16, 2010 at 9:39 AM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

Sorry I double checked with the docs and I think I gave you wrong hint.

Lukas

On Fri, Jul 16, 2010 at 9:34 AM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Thanks. But still nothing...

franz@see:~$ curl -XGET http://localhost:9200/myindex/myType/_search -d
'
{
"query" : { "from" : 0, "size" : 10 }
}
'
{"error":"SearchPhaseExecutionException[Failed to execute [query] total
failure; shardFailures {[abaf7629-100b-4740-a716-56823787a3b9][myindex][4]:
SearchParseException[[myindex][4]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][2]:
SearchParseException[[myindex][2]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][0]:
SearchParseException[[myindex][0]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][1]:
SearchParseException[[myindex][1]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][3]:
SearchParseException[[myindex][3]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]]; }]"}

On Fri, Jul 16, 2010 at 3:31 PM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

Hi,

if I am not mistaken then you are missing a "query" portion in your
JSON.

curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"query" : {
"from" : 0, "size" : 10
}
}
'

Regards,
Lukas

On Fri, Jul 16, 2010 at 9:24 AM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Pardon, but how exactly?

I'm getting this:
franz@see:~$ curl -XGET http://localhost:9200/myindex/myType/_search-d '

{
"from" : 0, "size" : 10
}
'
{"error":"SearchPhaseExecutionException[Failed to execute [query]
total failure; shardFailures
{[abaf7629-100b-4740-a716-56823787a3b9][application][0]:
SearchParseException[[application][0]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][4]:
SearchParseException[[application][4]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][3]:
SearchParseException[[application][3]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][2]:
SearchParseException[[application][2]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][1]:
SearchParseException[[application][1]: query[null],from[0],size[10]: Parse
Failure [No query specified in search request]]}]"}

I didn't enter a query because I wanted to see all contents of the
myindex/myType.

Thanks,

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

On Tue, Jul 13, 2010 at 1:59 AM, Shay Banon <
shay.banon@elasticsearch.com> wrote:

From and size are exposed in the REST API as well. You can use scroll
request as well, but note that scroll should not be used to execute many
concurrent search requests.

-shay.banon

On Mon, Jul 12, 2010 at 8:21 AM, Samuel Doyle <samueldoyle@gmail.com

wrote:

If you are using Java you can use from and size on the builder.

http://www.elasticsearch.com/docs/elasticsearch/java_api/search/

On Sun, Jul 11, 2010 at 8:06 PM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Currently, I can search for entries in an index + type. But if I
wan to list it and paginate through it, how can I do that with
ElasticSearch?

Thanks,

Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see


(Franz Allan Valencia See) #11

Thanks!, It works ! :smiley:

curl -XGET http://localhost:9200/myindex/myType/_search?pretty=1 -d '
{
"query" : { "match_all" : { } }
}
'

On Fri, Jul 16, 2010 at 4:04 PM, Lukáš Vlček lukas.vlcek@gmail.com wrote:

Here is the query you can use (finally I tested this on my system and it
works!). I was missing the "query" portion of JSON in my previous post.

curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"query" : { "match_all" : {}},
"from" : 0, "size" : 10
}
'
Regards,
Lukas

On Fri, Jul 16, 2010 at 9:53 AM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

May be you can try use Match All Query (
http://www.elasticsearch.com/docs/elasticsearch/rest_api/query_dsl/match_all_query/
)

curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"match_all" : {},
"from" : 0, "size" : 10
}
'

Lukas

On Fri, Jul 16, 2010 at 9:46 AM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

So if I understand correctly you just want to paginate on documents
stored in ES without specifying a query, meaning without specifying the
order of documents. (As the query is what determines relevancy and order of
documents). Do you think you can elaborate more on what your goal is?

Lukas

On Fri, Jul 16, 2010 at 9:39 AM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

Sorry I double checked with the docs and I think I gave you wrong hint.

Lukas

On Fri, Jul 16, 2010 at 9:34 AM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Thanks. But still nothing...

franz@see:~$ curl -XGET http://localhost:9200/myindex/myType/_search-d '
{
"query" : { "from" : 0, "size" : 10 }
}
'
{"error":"SearchPhaseExecutionException[Failed to execute [query] total
failure; shardFailures {[abaf7629-100b-4740-a716-56823787a3b9][myindex][4]:
SearchParseException[[myindex][4]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][2]:
SearchParseException[[myindex][2]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][0]:
SearchParseException[[myindex][0]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][1]:
SearchParseException[[myindex][1]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][3]:
SearchParseException[[myindex][3]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]]; }]"}

On Fri, Jul 16, 2010 at 3:31 PM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

Hi,

if I am not mistaken then you are missing a "query" portion in your
JSON.

curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"query" : {
"from" : 0, "size" : 10
}
}
'

Regards,
Lukas

On Fri, Jul 16, 2010 at 9:24 AM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Pardon, but how exactly?

I'm getting this:
franz@see:~$ curl -XGET http://localhost:9200/myindex/myType/_search-d '

{
"from" : 0, "size" : 10
}
'
{"error":"SearchPhaseExecutionException[Failed to execute [query]
total failure; shardFailures
{[abaf7629-100b-4740-a716-56823787a3b9][application][0]:
SearchParseException[[application][0]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][4]:
SearchParseException[[application][4]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][3]:
SearchParseException[[application][3]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][2]:
SearchParseException[[application][2]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][1]:
SearchParseException[[application][1]: query[null],from[0],size[10]: Parse
Failure [No query specified in search request]]}]"}

I didn't enter a query because I wanted to see all contents of the
myindex/myType.

Thanks,

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

On Tue, Jul 13, 2010 at 1:59 AM, Shay Banon <
shay.banon@elasticsearch.com> wrote:

From and size are exposed in the REST API as well. You can use
scroll request as well, but note that scroll should not be used to execute
many concurrent search requests.

-shay.banon

On Mon, Jul 12, 2010 at 8:21 AM, Samuel Doyle <
samueldoyle@gmail.com> wrote:

If you are using Java you can use from and size on the builder.

http://www.elasticsearch.com/docs/elasticsearch/java_api/search/

On Sun, Jul 11, 2010 at 8:06 PM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Currently, I can search for entries in an index + type. But if I
wan to list it and paginate through it, how can I do that with
ElasticSearch?

Thanks,

Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see


(Lukáš Vlček) #12

Good! Sorry for all that mess... I am kind slower this morning :-/
Just one more note, I am not sure you can count on any particular order of
returned documents in this case.

Regards,
Lukas

On Fri, Jul 16, 2010 at 10:06 AM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Thanks!, It works ! :smiley:

curl -XGET http://localhost:9200/myindex/myType/_search?pretty=1 -d '
{
"query" : { "match_all" : { } }
}
'

On Fri, Jul 16, 2010 at 4:04 PM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

Here is the query you can use (finally I tested this on my system and it
works!). I was missing the "query" portion of JSON in my previous post.

curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"query" : { "match_all" : {}},
"from" : 0, "size" : 10
}
'
Regards,
Lukas

On Fri, Jul 16, 2010 at 9:53 AM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

May be you can try use Match All Query (
http://www.elasticsearch.com/docs/elasticsearch/rest_api/query_dsl/match_all_query/
)

curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"match_all" : {},
"from" : 0, "size" : 10
}
'

Lukas

On Fri, Jul 16, 2010 at 9:46 AM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

So if I understand correctly you just want to paginate on documents
stored in ES without specifying a query, meaning without specifying the
order of documents. (As the query is what determines relevancy and order of
documents). Do you think you can elaborate more on what your goal is?

Lukas

On Fri, Jul 16, 2010 at 9:39 AM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

Sorry I double checked with the docs and I think I gave you wrong hint.

Lukas

On Fri, Jul 16, 2010 at 9:34 AM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Thanks. But still nothing...

franz@see:~$ curl -XGET http://localhost:9200/myindex/myType/_search-d '
{
"query" : { "from" : 0, "size" : 10 }
}
'
{"error":"SearchPhaseExecutionException[Failed to execute [query]
total failure; shardFailures
{[abaf7629-100b-4740-a716-56823787a3b9][myindex][4]:
SearchParseException[[myindex][4]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][2]:
SearchParseException[[myindex][2]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][0]:
SearchParseException[[myindex][0]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][1]:
SearchParseException[[myindex][1]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][3]:
SearchParseException[[myindex][3]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]]; }]"}

On Fri, Jul 16, 2010 at 3:31 PM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

Hi,

if I am not mistaken then you are missing a "query" portion in your
JSON.

curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"query" : {
"from" : 0, "size" : 10
}
}
'

Regards,
Lukas

On Fri, Jul 16, 2010 at 9:24 AM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Pardon, but how exactly?

I'm getting this:
franz@see:~$ curl -XGET
http://localhost:9200/myindex/myType/_search -d '

{
"from" : 0, "size" : 10
}
'
{"error":"SearchPhaseExecutionException[Failed to execute [query]
total failure; shardFailures
{[abaf7629-100b-4740-a716-56823787a3b9][application][0]:
SearchParseException[[application][0]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][4]:
SearchParseException[[application][4]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][3]:
SearchParseException[[application][3]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][2]:
SearchParseException[[application][2]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][1]:
SearchParseException[[application][1]: query[null],from[0],size[10]: Parse
Failure [No query specified in search request]]}]"}

I didn't enter a query because I wanted to see all contents of the
myindex/myType.

Thanks,

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

On Tue, Jul 13, 2010 at 1:59 AM, Shay Banon <
shay.banon@elasticsearch.com> wrote:

From and size are exposed in the REST API as well. You can use
scroll request as well, but note that scroll should not be used to execute
many concurrent search requests.

-shay.banon

On Mon, Jul 12, 2010 at 8:21 AM, Samuel Doyle <
samueldoyle@gmail.com> wrote:

If you are using Java you can use from and size on the builder.

http://www.elasticsearch.com/docs/elasticsearch/java_api/search/

On Sun, Jul 11, 2010 at 8:06 PM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Currently, I can search for entries in an index + type. But if I
wan to list it and paginate through it, how can I do that with
ElasticSearch?

Thanks,

Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see


(Franz Allan Valencia See) #13

Thanks for the warning. But I'm planning to find the max on one field
actually which means I'm planning to use it with the "sort" functionality (
http://www.elasticsearch.com/docs/elasticsearch/rest_api/search/) :slight_smile:

Thanks,

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

On Fri, Jul 16, 2010 at 4:10 PM, Lukáš Vlček lukas.vlcek@gmail.com wrote:

Good! Sorry for all that mess... I am kind slower this morning :-/
Just one more note, I am not sure you can count on any particular order of
returned documents in this case.

Regards,
Lukas

On Fri, Jul 16, 2010 at 10:06 AM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Thanks!, It works ! :smiley:

curl -XGET http://localhost:9200/myindex/myType/_search?pretty=1 -d '
{
"query" : { "match_all" : { } }
}
'

On Fri, Jul 16, 2010 at 4:04 PM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

Here is the query you can use (finally I tested this on my system and it
works!). I was missing the "query" portion of JSON in my previous post.

curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"query" : { "match_all" : {}},
"from" : 0, "size" : 10
}
'
Regards,
Lukas

On Fri, Jul 16, 2010 at 9:53 AM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

May be you can try use Match All Query (
http://www.elasticsearch.com/docs/elasticsearch/rest_api/query_dsl/match_all_query/
)

curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"match_all" : {},
"from" : 0, "size" : 10
}
'

Lukas

On Fri, Jul 16, 2010 at 9:46 AM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

So if I understand correctly you just want to paginate on documents
stored in ES without specifying a query, meaning without specifying the
order of documents. (As the query is what determines relevancy and order of
documents). Do you think you can elaborate more on what your goal is?

Lukas

On Fri, Jul 16, 2010 at 9:39 AM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

Sorry I double checked with the docs and I think I gave you wrong
hint.

Lukas

On Fri, Jul 16, 2010 at 9:34 AM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Thanks. But still nothing...

franz@see:~$ curl -XGET http://localhost:9200/myindex/myType/_search-d '
{
"query" : { "from" : 0, "size" : 10 }
}
'
{"error":"SearchPhaseExecutionException[Failed to execute [query]
total failure; shardFailures
{[abaf7629-100b-4740-a716-56823787a3b9][myindex][4]:
SearchParseException[[myindex][4]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][2]:
SearchParseException[[myindex][2]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][0]:
SearchParseException[[myindex][0]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][1]:
SearchParseException[[myindex][1]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][3]:
SearchParseException[[myindex][3]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]]; }]"}

On Fri, Jul 16, 2010 at 3:31 PM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

Hi,

if I am not mistaken then you are missing a "query" portion in your
JSON.

curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"query" : {
"from" : 0, "size" : 10
}
}
'

Regards,
Lukas

On Fri, Jul 16, 2010 at 9:24 AM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Pardon, but how exactly?

I'm getting this:
franz@see:~$ curl -XGET
http://localhost:9200/myindex/myType/_search -d '

{
"from" : 0, "size" : 10
}
'
{"error":"SearchPhaseExecutionException[Failed to execute [query]
total failure; shardFailures
{[abaf7629-100b-4740-a716-56823787a3b9][application][0]:
SearchParseException[[application][0]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][4]:
SearchParseException[[application][4]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][3]:
SearchParseException[[application][3]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][2]:
SearchParseException[[application][2]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][1]:
SearchParseException[[application][1]: query[null],from[0],size[10]: Parse
Failure [No query specified in search request]]}]"}

I didn't enter a query because I wanted to see all contents of the
myindex/myType.

Thanks,

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

On Tue, Jul 13, 2010 at 1:59 AM, Shay Banon <
shay.banon@elasticsearch.com> wrote:

From and size are exposed in the REST API as well. You can use
scroll request as well, but note that scroll should not be used to execute
many concurrent search requests.

-shay.banon

On Mon, Jul 12, 2010 at 8:21 AM, Samuel Doyle <
samueldoyle@gmail.com> wrote:

If you are using Java you can use from and size on the builder.

http://www.elasticsearch.com/docs/elasticsearch/java_api/search/

On Sun, Jul 11, 2010 at 8:06 PM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Currently, I can search for entries in an index + type. But if I
wan to list it and paginate through it, how can I do that with
ElasticSearch?

Thanks,

Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see


(Shay Banon) #14

In 0.9, you will be able to use the statistical facet to get the maximum
value for a field.

On Fri, Jul 16, 2010 at 11:20 AM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Thanks for the warning. But I'm planning to find the max on one field
actually which means I'm planning to use it with the "sort" functionality (
http://www.elasticsearch.com/docs/elasticsearch/rest_api/search/) :slight_smile:

Thanks,

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

On Fri, Jul 16, 2010 at 4:10 PM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

Good! Sorry for all that mess... I am kind slower this morning :-/
Just one more note, I am not sure you can count on any particular order of
returned documents in this case.

Regards,
Lukas

On Fri, Jul 16, 2010 at 10:06 AM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Thanks!, It works ! :smiley:

curl -XGET http://localhost:9200/myindex/myType/_search?pretty=1 -d '
{
"query" : { "match_all" : { } }
}
'

On Fri, Jul 16, 2010 at 4:04 PM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

Here is the query you can use (finally I tested this on my system and it
works!). I was missing the "query" portion of JSON in my previous post.

curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"query" : { "match_all" : {}},
"from" : 0, "size" : 10
}
'
Regards,
Lukas

On Fri, Jul 16, 2010 at 9:53 AM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

May be you can try use Match All Query (
http://www.elasticsearch.com/docs/elasticsearch/rest_api/query_dsl/match_all_query/
)

curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"match_all" : {},
"from" : 0, "size" : 10
}
'

Lukas

On Fri, Jul 16, 2010 at 9:46 AM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

So if I understand correctly you just want to paginate on documents
stored in ES without specifying a query, meaning without specifying the
order of documents. (As the query is what determines relevancy and order of
documents). Do you think you can elaborate more on what your goal is?

Lukas

On Fri, Jul 16, 2010 at 9:39 AM, Lukáš Vlček lukas.vlcek@gmail.comwrote:

Sorry I double checked with the docs and I think I gave you wrong
hint.

Lukas

On Fri, Jul 16, 2010 at 9:34 AM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Thanks. But still nothing...

franz@see:~$ curl -XGET
http://localhost:9200/myindex/myType/_search -d '
{
"query" : { "from" : 0, "size" : 10 }
}
'
{"error":"SearchPhaseExecutionException[Failed to execute [query]
total failure; shardFailures
{[abaf7629-100b-4740-a716-56823787a3b9][myindex][4]:
SearchParseException[[myindex][4]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][2]:
SearchParseException[[myindex][2]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][0]:
SearchParseException[[myindex][0]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][1]:
SearchParseException[[myindex][1]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]];
}{[abaf7629-100b-4740-a716-56823787a3b9][myindex][3]:
SearchParseException[[myindex][3]: query[null],from[-1],size[-1]: Parse
Failure [Failed to parse [\n{\n "query" : { "from" : 0, "size" : 10
}\n}\n]]]; nested: QueryParsingException[[myindex] No query parser
registered for [from]]; }]"}

On Fri, Jul 16, 2010 at 3:31 PM, Lukáš Vlček <lukas.vlcek@gmail.com

wrote:

Hi,

if I am not mistaken then you are missing a "query" portion in your
JSON.

curl -XGET http://localhost:9200/myindex/myType/_search -d '
{
"query" : {
"from" : 0, "size" : 10
}
}
'

Regards,
Lukas

On Fri, Jul 16, 2010 at 9:24 AM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Pardon, but how exactly?

I'm getting this:
franz@see:~$ curl -XGET
http://localhost:9200/myindex/myType/_search -d '

{
"from" : 0, "size" : 10
}
'
{"error":"SearchPhaseExecutionException[Failed to execute [query]
total failure; shardFailures
{[abaf7629-100b-4740-a716-56823787a3b9][application][0]:
SearchParseException[[application][0]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][4]:
SearchParseException[[application][4]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][3]:
SearchParseException[[application][3]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][2]:
SearchParseException[[application][2]: query[null],from[0],size[10]: Parse
Failure [No query specified in search
request]]}{[abaf7629-100b-4740-a716-56823787a3b9][application][1]:
SearchParseException[[application][1]: query[null],from[0],size[10]: Parse
Failure [No query specified in search request]]}]"}

I didn't enter a query because I wanted to see all contents of the
myindex/myType.

Thanks,

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

On Tue, Jul 13, 2010 at 1:59 AM, Shay Banon <
shay.banon@elasticsearch.com> wrote:

From and size are exposed in the REST API as well. You can use
scroll request as well, but note that scroll should not be used to execute
many concurrent search requests.

-shay.banon

On Mon, Jul 12, 2010 at 8:21 AM, Samuel Doyle <
samueldoyle@gmail.com> wrote:

If you are using Java you can use from and size on the builder.

http://www.elasticsearch.com/docs/elasticsearch/java_api/search/

On Sun, Jul 11, 2010 at 8:06 PM, Franz Allan Valencia See <
franz.see@gmail.com> wrote:

Currently, I can search for entries in an index + type. But if
I wan to list it and paginate through it, how can I do that with
ElasticSearch?

Thanks,

Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see

--
Franz Allan Valencia See | Java Software Engineer
franz.see@gmail.com
LinkedIn: http://www.linkedin.com/in/franzsee
Twitter: http://www.twitter.com/franz_see


(system) #15