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

LOC bug when using "--" #61

Open
scande3 opened this issue Jun 27, 2014 · 5 comments
Open

LOC bug when using "--" #61

scande3 opened this issue Jun 27, 2014 · 5 comments
Milestone

Comments

@scande3
Copy link
Contributor

scande3 commented Jun 27, 2014

Setup / Expected

The documentation gives the following example:

/qa/search/loc/subjects?q=History--

QA then presents this data to you in JSON format:

[
    {"id":"info:lc/authorities/subjects/sh2008121753","label":"History--Philosophy--History--20th century"},
    {"id":"info:lc/authorities/subjects/sh2008121752","label":"History--Philosophy--History--19th century"},
    etc...
]

Actual

The data actually returned is more like the following

[
    {"id":"info:lc/authorities/subjects/sh85111862","label":"Reconstruction (U.S. history, 1865-1877)"},
    {"id":"info:lc/authorities/subjects/sh85061255","label":"History publishing"},
    etc...
    {"id":"info:lc/authorities/subjects/sh85068444","label":"Islamic Empire"},
]

The Issue

A "--" does not seem to be processed correctly. For example, searching for "History Philosophy" will return results more like the first example. As is, about half of the results currently do not contain the word "history" nor any "--". I have no yet done appropriate research into details of this behavior besides noticing it during recent testing.

@scande3
Copy link
Contributor Author

scande3 commented Jun 27, 2014

Related unit test that doesn't work:

it "should be retrieved via search" do
  @authority.search("History--", "subjects")
  @authority.results.first["label"].should == "History--Philosophy--History--20th century"
end

@awead
Copy link
Contributor

awead commented Jul 17, 2014

The problem seems to lie with LOC itself. This returns the same result http://id.loc.gov/search/?q=History--&q=
However, if you add a wildcard to the query it works: History--*
We could automatically append the wildcard to all searches.

@scande3
Copy link
Contributor Author

scande3 commented Jul 17, 2014

We automatically appended the wildcard in the past but that seemed to cause other issues. See the discussion over the removal of the wildcard in pull request #49 . Possibly need some logic to only append it in certain cases? Or make it a setting of some sort?

@awead
Copy link
Contributor

awead commented Jul 17, 2014

Ah, thanks for pointing that out... completely forgot about it. I guess I'd lean towards an option to pass via the url or something, as it will vary per authority.

@mjgiarlo mjgiarlo modified the milestone: Backlog Mar 21, 2017
@miledrousset
Copy link

Hi,
I saw in the documentation this uri :
qa/search/getty/aat?q=amphora
do you have the full URL to get this result :
{"id":"http://vocab.getty.edu/aat/300198849","label":"Nolan amphorae"},
{"id":"http://vocab.getty.edu/aat/300200366","label":"Panathenaic amphorae"}
I try with :
http://vocab.getty.edu/qa/search/getty/aat?q=amphora
or
https://vocab.getty.edu/qa/search/getty/aat?q=amphora
but, no result !
Can you help me please ?
thank you

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

No branches or pull requests

4 participants