Query arg "fields" no longer accepts type name


(Jamshid) #1

Been running 0.17.8, trying out 0.19.0RC2, but I see this difference
in the Query URI syntax.

Just thought I'd mention it in case it's not an intentional change. It
might have happened in an earlier release.

Create the twitter index from elasticsearch.org home page and this
query used to work:

curl -i 'http://localhost:9200/twitter/_search?
pretty=yes&fields=tweet.message'
...
"hits" : [ { ...
"fields" : {
"tweet.message" : "Trying out elasticsearch, so far so good?"
}
...

but now that returns no "fields" element. I have to remove the type
name "tweet" in "fields":

curl -i 'http://localhost:9200/twitter/_search?
pretty=yes&fields=message'

Also, I used to be able to do this as a quick test to return some
results:

curl -i 'http://localhost:9200/twitter/_search?pretty=yes'

but now that gives a 500 "ActionRequestValidationException[Validation
Failed: 1: search source is missing;]"

Not a big deal, I can just do this:

curl -i 'http://localhost:9200/twitter/_search?pretty=yes&from=0'

Thanks,
Jamshid


(Shay Banon) #2

Heya,

I fixed the one with no parameters for search request: https://github.com/elasticsearch/elasticsearch/issues/1696. The one with the field name, yea, it has changed. Basically, all the fetch based on field names has been improved to return better results. The only part that does not happen now is resolving field names to their full structure (so an object called title, with a field named name, requires asking for title.name), the reason for that is that you might have "name" happening in other places in the json, and returning just the first one was confusing.

On Friday, February 10, 2012 at 11:50 PM, Jamshid wrote:

Been running 0.17.8, trying out 0.19.0RC2, but I see this difference
in the Query URI syntax.

Just thought I'd mention it in case it's not an intentional change. It
might have happened in an earlier release.

Create the twitter index from elasticsearch.org (http://elasticsearch.org) home page and this
query used to work:

curl -i 'http://localhost:9200/twitter/_search?
pretty=yes&fields=tweet.message'
...
"hits" : [ { ...
"fields" : {
"tweet.message" : "Trying out elasticsearch, so far so good?"
}
...

but now that returns no "fields" element. I have to remove the type
name "tweet" in "fields":

curl -i 'http://localhost:9200/twitter/_search?
pretty=yes&fields=message'

Also, I used to be able to do this as a quick test to return some
results:

curl -i 'http://localhost:9200/twitter/_search?pretty=yes'

but now that gives a 500 "ActionRequestValidationException[Validation
Failed: 1: search source is missing;]"

Not a big deal, I can just do this:

curl -i 'http://localhost:9200/twitter/_search?pretty=yes&from=0'

Thanks,
Jamshid


(system) #3