eladsegal/strategyqa

What fields to search on for elasticsearch?

Opened this issue · 1 comments

I'm trying to use elasticsearch for custom queries not in the cache.

What fields did you match on? I'm unable to replicate the results in the cache with either of these search bodies for client.search(... where the index was created using the index_wikipedia script

126 search_body = {
127 "query": {
128 "match": {"text": query}
129 }
130 }

133 search_body = {
134 "query": {
135 "multi_match": {
136 "query": query,
137 "fields": ["text", "title"]
138 }
139 }
140 }

Specifically I tried
question = "Are more people today related to Genghis Khan than Julius Caesar?"
query = clean_query(question)
And then I put the query in the search body.

The max score I'm getting is in the 30s, but the max score from the cache is in the 70s.

By the way, I tried this too from vim src/data/dataset_readers/utils/elasticsearch_utils.py
response = client.search(index, params={"concept": query}) , but I got an error on "concept"

To clarify, if I do it this way

requests.get(ELASTICSEARCH_RETRIEVAL_URL, params={"concept": query})

then I get this error: 'illegal_argument_exception', 'reason': 'request [/] contains unrecognized parameter: [concept]'