You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to dynamically query if an index exists or not using the following code snippet:
let myindex = get a &str here (tried it with clone() as well)
let response = match client.index_exists(index(myindex)).send() {
Ok(x) => x,
Err(x) => panic!("Could not send an Index Exists request.")
};
and I get the following error:
| let myindex = get a &str here (tried it with clone() as well)
| ^^^^^^^^^^-------------------
| |
| borrowed value does not live long enough
| } <- END OF PROGRAM
| - `myindex` dropped here while still borrowed
The text was updated successfully, but these errors were encountered:
This is just for simplicity on the client side, but it isn't strictly necessary and I'd like to fix it up so you can use borrowed data (since we do eventually just build an owned url from it). In the meantime you can create an owned string to use:
let myindex = get a &strhere(tried it with clone()aswell)
let response = match client.index(myindex.to_owned()).exists().send(){Ok(x) => x,Err(x) => panic!("Could not send an Index Exists request.")};
We've got #313 to track fixing this up so I'll close this one in favour of that issue. Please feel free to re-open though if you run into any more problems!
Description
I am trying to dynamically query if an index exists or not using the following code snippet:
and I get the following error:
The text was updated successfully, but these errors were encountered: