I'm getting SearchParseException for constant_score query with one term filter


(Jae Lee) #1

Hi,

I'm getting a SearchParseException when I do

post 127.0.0.1:9200 /index/type/_search?size=10
{"constant_score":{"filter":{"term":{"site":"fr"}}}}

Caused by: org.elasticsearch.search.SearchParseException: [index][4]:
from[-1],size[-1]: Parse Failure [No parser for element [constant_score]]

whereas if I do

post 127.0.0.1:9200 /index/type/_search?size=10
{"query":{"term":{"site":"fr"}}}

it's fine...

Am I doing something very simple very wrong?

J


(Jae Lee) #2

oh don't worry, I figured out you still need to wrap the whole thing with
query :{}

so this works fine

post 127.0.0.1:9200 /index/type/_search?size=10
{"query":{"constant_score":{"filter":{"term":{"site":"fr"}}}}}

On Sun, Mar 6, 2011 at 2:28 PM, Jae Lee jlee119@gmail.com wrote:

Hi,

I'm getting a SearchParseException when I do

post 127.0.0.1:9200 /index/type/_search?size=10
{"constant_score":{"filter":{"term":{"site":"fr"}}}}

Caused by: org.elasticsearch.search.SearchParseException: [index][4]:
from[-1],size[-1]: Parse Failure [No parser for element [constant_score]]

whereas if I do

post 127.0.0.1:9200 /index/type/_search?size=10
{"query":{"term":{"site":"fr"}}}

it's fine...

Am I doing something very simple very wrong?

J


(system) #3