koursaros-ai / nboost

NBoost is a scalable, search-api-boosting platform for deploying transformer models to improve the relevance of search results on different platforms (i.e. Elasticsearch)
Apache License 2.0
675 stars 69 forks source link

Nested query in nboost #91

Open kapish5467 opened 4 years ago

kapish5467 commented 4 years ago

I am trying to run a nboost search query on nested data which is - "description":{"type":"nested","properties":{"BRIEF_SUMMARY":{"type":"nested","properties":{"plain":{"type":"text","analyzer":"my_analyzer"}}}

I want to look for contents in "plain" field and I am running following python script for it- response = requests.get( url='http://localhost:8000/patents/_search', json={ 'nboost': { 'uhost': 'localhost', 'uport': 9200, 'query_path': 'body.query.nested.match.description.BRIEF_SUMMARY.plain', 'topk_path': 'body.size', 'default_topk': 10, 'topn': 200, 'choices_path': 'body.hits.hits', 'cvalues_path': '_source.description.BRIEF_SUMMARY.plain' }, 'size': 200, 'query': {'nested': {'path': 'description', 'query': {'nested': {'path':'description.BRIEF_SUMMARY', 'query': {'match': { 'description.BRIEF_SUMMARY.plain':}}}}}} }

)

But I end up with following error- {'doc': 'Mapping key not found.', 'msg': "('match',)", 'type': 'KeyError'}

Is this kind of query handled by nboost ?