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

Can I do multiple query? #98

Open we29758143 opened 3 years ago

we29758143 commented 3 years ago

Here is an example for my query. I added another field 'Name' in travel.csv. I successfully generated the nboost-index already. I am wondering am I making any mistake while doing the query?

The reason is I want to make query on both 'Name' and 'passage' fields, in order to make my result to be more specific. I am wondering can I do that?

import requests from pprint import pprint

response = requests.get( url='http://localhost:8000/travel_add/_search', json={ 'nboost': { 'uhost': 'localhost', 'uport': 9200, 'query_path': 'body.query.match.', 'topk_path': 'body.size', 'default_topk': 10, 'topn': 50, 'choices_path': 'body.hits.hits', 'cvalues_path': '_source.' }, 'size': 10, 'query': { 'match': {'Name': 'Jack', 'passage': 'flight'} } } )

pprint(response.json())


Error message: {'doc': 'Mapping key not found.', 'msg': "('hits',)", 'type': 'KeyError'}