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

Is search by subjects using AND or OR ? #53

Open
huard opened this issue May 30, 2023 · 3 comments
Open

Is search by subjects using AND or OR ? #53

huard opened this issue May 30, 2023 · 3 comments

Comments

@huard
Copy link

huard commented May 30, 2023

Testing suggests it's using OR, but it would nice to have confirmation in the docs. Is there a way to refine search with AND ?
And is it the same for full_text_search?

@aaraney
Copy link
Member

aaraney commented May 30, 2023

Not that im aware of, @huard. The search method is calling HydroShare's /hsapi/resource/ rest api endpoint. To my knowledge, it uses OR as you mentioned. Here is HydroShare's swagger documentation as a second reference. @sblack-usu, can you confirm that?

@sblack-usu
Copy link
Collaborator

There is not an and option for that endpoint. It is a search endpoint that was written a long time ago for basic searches. If you need something more involved, you could hit the haystack endpoint. We use drf-haystack to expose the full solr search capabilities through the rest api. I hooked it up years ago and I don't think anyone has used it because the basic search is easier to get started with and has met user needs.

If you would like to use it, here are the docs on how to create queries.
https://drf-haystack.readthedocs.io/en/latest/01_intro.html#query-time

The endpoint is /hsapi/resource/search. The request/response models for that endpoint are fully documented on the swagger page that Austin linked. You should be able to craft any query you'd like with that endpoint but it is more difficult and not integrated with hsclient.

@sblack-usu
Copy link
Collaborator

As I said, nobody has used this endpoint. I was looking it over and testing it out today and saw that the resource id is not returned with the results. I filed an issue, it is easily resolved.

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

3 participants