Skip to content

Can I do multiple query? #98

@we29758143

Description

@we29758143

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions