Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I do multiple query? #98

Open
we29758143 opened this issue Feb 8, 2021 · 0 comments
Open

Can I do multiple query? #98

we29758143 opened this issue Feb 8, 2021 · 0 comments

Comments

@we29758143
Copy link

we29758143 commented Feb 8, 2021

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'}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant