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

XIVAPIClient.index_search() raises XIVAPIError with any wildcard query #13

Open
Terlen opened this issue Aug 16, 2021 · 0 comments
Open

Comments

@Terlen
Copy link

Terlen commented Aug 16, 2021

Don't know if this repo is maintained anymore but thought I'd mention an error I ran into!

Passing any query to XIVAPIClient.index_search() with string_algo="wildcard" raises an XIVAPIError exception.

This occurs because the "wildcard" query type does not support the "query" parameter, as explained by the response.

{'Error': True, 
'Subject':` 'XIVAPI ERROR', 
'Note': 'Get on discord: https://discord.gg/MFFVHWC', 
'Message': 'Search Error: {
    "error":{
        "root_cause":[{
            "type":"parsing_exception",
            "reason":"[wildcard] query does not support [query]","line":1,"col":69
        }],
        "type":"parsing_exception",
        "reason":"[wildcard] query does not support [query]",
        "line":1,"col":69
    },
"status":400
}', 
'Hash': '61969353bd46e810ce74ee1177e0d79b0c1bf5f2', 
'Ex': 'App\\Common\\Exceptions\\SearchException', 
'ExCode': 500, 
'Url': '', 
'Debug': {
    'ID': 'Yn60aZfP21081602', 
    'File': '#55 xivapi.com/src/Controller/SearchController.php', 
    'Method': 'POST', 
    'Path': '/search', 
    'Action': 'App\\Controller\\SearchController::search', 
    'Code': 500, 
    'Date': '2021-08-16 14:10:10', 
    'Env': 'prod'
}
}`

This can be fixed by ensuring "wildcard" queries are constructed with the correct parameters like the following:

'wildcard': {
                NameCombined_en: {
                "value": name,
                "boost": 1.0,
                "rewrite": "constant_score"
                }
            }
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