Hi,
We have a ES setup that indexes on the table(Restaurant) on various fields
like title, address, city, state, city etc. Also we define a restaurant
title analyzer with a custom 'stop and 'synonym' filters that defines a
bunch of stopwords and synonyms. The stopwords is an array that looks
like STOPWORDS =
["an","and","at","el","for","il","in","la","le","menu","of","on","restaurant","restaurants","the"]
that we want filtered during the search.
I am now seeing that certain search queries are failing with a parsing
failure like below, and in most cases I see that the error happened when
the title string either starts or ends with a stopword. Not sure if that
is in any way impacting the error but I can't seem to tell whats wrong with
the search term to trigger a parse error, other than these tiltles start or
ends with words like NOT, AND and the likes of a stopword.
Any help would be appreciated. Here are a few CURLs and an error output
from ES:
curl -X GET
'http://172.16.21.21:9200/production_restaurants/_search?from=0&size=5&pretty'
-d '{"query":{"bool":{"should":[{"query_string":{"query":"title: *ANDBREAKFAST
*","boost":50}},{"query_string":{"query":"address: 808 PARK
AVE","boost":50}},{"query_string":{"query":"phone:
5016244267","boost":25}}]}},"filter":{"term":{"city_id":165}},"size":5,"from":0}'
nested: QueryParsingException[[production_restaurants] Failed to parse
query [title: AND BREAKFAST]]; nested: ParseException[Cannot parse 'title:
AND BREAKFAST': Encountered " "AND "" at line 1, column 7.\nWas
expecting one of:\n ...\n "(" ...\n "" ...\n
...\n ...\n ...\n ...\n
"[" ...\n "{" ...\n ...\n ]; nested:
ParseException[Encountered " "AND "" at line 1, column 7.\nWas
expecting one of:\n ...\n "(" ...\n "" ...\n
...\n ...\n ...\n ...\n
"[" ...\n "{" ...\n ...\n ]; }
curl -X GET
'http://172.16.21.21:9200/production_restaurants/_search?from=0&size=5&pretty'
-d '{"query":{"bool":{"should":[{"query_string":{"query":"title: NOT JUST
PIZZA","boost":50}},{"query_string":{"query":"address: 2860 CERRILLOS
RD","boost":50}},{"query_string":{"query":"phone:
5054700955","boost":25}}]}},"filter":{"term":{"city_id":279}},"size":5,"from":0}'
curl -X GET
'http://172.16.21.21:9200/production_restaurants/_search?from=0&size=5&pretty'
-d '{"query":{"bool":{"should":[{"query_string":{"query":"title: NOT YOUR
AVERAGE JOES","boost":50}},{"query_string":{"query":"address: 1125 FALL
RIVER AVE","boost":50}},{"query_string":{"query":"phone:
5083435637","boost":25}}]}},"filter":{"term":{"city_id":41}},"size":5,"from":0}'
curl -X GET
'http://172.16.21.21:9200/production_restaurants/_search?from=0&size=5&pretty'
-d '{"query":{"bool":{"should":[{"query_string":{"query":"title: RIVALS
SPORTS BAR GRILL AND","boost":50}},{"query_string":{"query":"address: 2650
NE DIVISION ST","boost":50}},{"query_string":{"query":"phone:
5415507771","boost":25}}]}},"filter":{"term":{"city_id":89}},"size":5,"from":0}'
thanks
-anurag
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.