bumblebee icon indicating copy to clipboard operation
bumblebee copied to clipboard

Save/Recall Recent Searches

Open thostetler opened this issue 7 years ago • 2 comments

Save recent user searches in vault

thostetler avatar Oct 09 '18 20:10 thostetler

@kelockhart, do you know what backend work needs to be done for this? or what the end point I should be pointing at?

thostetler avatar Oct 09 '18 20:10 thostetler

@thostetler The relevant backend is in the vault microservice. Here are the endpoints:

  • /query (POST method) - the payload is the query, and it can be in urlencoded format or in application/json. If it's application/json, a bigquery can also be passed: { query: {foo: bar}, bigquery: 'data\ndata\n....' }. This will store a given query, along with the number of records found. The return is a hash of the original query (qid) along with the number of records found (numfound).
  • /query/ (GET method) - The is the same hash (qid) returned by the POST method above. The return is the qid, the original query, and the number of records found (this number is stored and is not refreshed by rerunning the search).
  • /execute_query/ (GET method) - The is the same as for the above GET request, or the hash of the original query. This endpoint re-executes the original stored query. The return is the return from the fresh Solr query and the status code of that query. The number of records found is not updated in the data storage.

So, use the first to store a new query, the second to fetch the query itself, and the third to fetch the latest results.

kelockhart avatar Oct 10 '18 19:10 kelockhart