Closed shagga closed 8 years ago
A couple of things:
`` for multiline code blocks or
for inline code blocks. It makes reading these easier.pretty
url parameter. The responses should be generated with that. They are so much easier to scan!terms
query instead of the terms
filter?Thanks Nik !! I'll take care of the points in future. HIghlighting worked with term query.
Hi All, I'm new to elastic search and have started exploring it from the past few days. My requirement is to get the matched keywords using term lookup highlighted.
So have 2 indices
http://localhost:9200/lookup/type/1?pretty Output { "_index" : "lookup", "_type" : "type", "_id" : "1", "_version" : 1, "found" : true, "_source":{"terms":["Apache Storm","Kafka","MR","Pig","Hive","Hadoop","Mahout"]} }
And another one as following:-
http://localhost:9200/skillsetanalyzer/resume/_search?fields=keySkills output {"took":19,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":3,"max_score":1.0,"hits":[{"_index":"skillsetanalyzer","_type":"resume","_id":"1","_score":1.0,"fields":{"keySkills":["Core Java","J2EE","Struts 1.x","SOAP based Web Services using JAX-WS","Maven","Ant","JMS","Apache Storm","Kafka","RDBMS (MySQL","Tomcat","Weblogic","Eclipse","Toad","TIBCO product Suite (Administrator","Business Work","Designer","EMS)","CVS","SVN"]}},
And below query returns the correct results but does not highlight the matched keywords.
curl -XGET 'localhost:9200/skillsetanalyzer/resume/_search?pretty' -d ' {
"query": {"filtered": {"filter": {"terms": {"keySkills": {"index":"lookup", "type":"type", "id":"1", "path":"terms" }, "_cache_key":"1" } } } }, "highlight": { "fields":{ "keySkills":{} } } }'
Field "KeySkills" is not analyzed and its type is String. I'm not able to make out what is wrong with the query. Please help in providing the necessary pointers.
Thanks !!