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

Search a term across all inputFields #3

Open
mgcaguioa opened this issue Jun 20, 2016 · 2 comments
Open

Search a term across all inputFields #3

mgcaguioa opened this issue Jun 20, 2016 · 2 comments
Assignees

Comments

@mgcaguioa
Copy link

Can I search a term across all input fields? For example, I'll search for poems with "William" on either title, author, or lines. Thanks.

@thundercomb
Copy link
Owner

At the moment these have to be separate queries, however I think it's a useful feature to add. Will look into it.

Thanks for reporting.

@thundercomb
Copy link
Owner

thundercomb commented Jun 15, 2020

Hi @mgcaguioa

Apologies for the long delay in investigating this request. Is this still a feature of interest to you? There appears to have been no other calls for the same feature during this period, however if it is still of value to you I can way weigh up the options for getting it implemented.

Below is some context and a way I can see it working with the API's current design.

As it stands today, a query along multiple input fields look for the intersection of the results, eg:

http://poetrydb.org/title,lines/roland;roland

Will bring back one poem, namely Robert Browning's "Childe Roland to the Dark Tower Came".

However a query supplying only title as input field:

http://poetrydb.org/title/roland

will bring back the Browning poem, and a query supplying only lines as input field will return 8 different poems (one of which is the same Browning poem):

http://poetrydb.org/lines/roland

Your suggestion pertains to the union of the latter two.

The current api structure doesn't permit a completely unambiguous way to do so, particularly if a combination of unions and intersections are to be catered for. Nevertheless, one possibility is to keep it simple and use the fact that if more than one input field has been requested, and only one search string has been provided, then it is a signal that the union across all input fields is being requested:

http://poetrydb.org/title,lines/roland

Which would be the equivalent of the union of:

http://poetrydb.org/title/roland
http://poetrydb.org/lines/roland

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants