Bookworm-project / BookwormDB

Tools for text tokenization and encoding
MIT License
84 stars 12 forks source link

"Click for texts" not displaying #102

Closed jonathandfitzgerald closed 8 years ago

jonathandfitzgerald commented 8 years ago

When I click for texts, I see the following warning in the terminal WARNING:root:method == "return_books" is deprecated. Use method="data" with format="books" instead.

I'm not sure I understand the message. How can I fix this?

bmschmidt commented 8 years ago

This sounds to me like it's related to the API normalization @organisciak made. One solution might be to try using the dev version of the API. The browser and the database backend are out of sync; nothing that you should have to fix.

But a warning shouldn't be breaking things, so maybe there's something else broken. Are you sure that you have a functioning 'searchstring' item in your field_descriptions?

organisciak commented 8 years ago

As Ben says, the warning is simply a reminder. It shouldn't break anything, but let us know if it does. I've started updating the API to use a new response format (the old one still works fine) and have the warning there to nudge forward the adoption of the new format by tools which call the API.

The version of the front end interface that uses the new format is still in the develop branch, so using the master branch still prompts the warning.

I think the new interface work should be ready soon to become the main interface, but if you want to give it a try early, you can git checkout develop. It has an interface overhaul and is a bit better at reporting errors to the user.

Peter

On Wed, May 4, 2016, 8:21 AM Benjamin Schmidt notifications@github.com wrote:

This sounds to me like it's related to the API normalization @organisciak https://github.com/organisciak made. One solution might be to try using the dev version of the API. The browser and the database backend are out of sync; nothing that you should have to fix.

But a warning shouldn't be breaking things, so maybe there's something else broken. Are you sure that you have a functioning 'searchstring' item in your field_descriptions?

— You are receiving this because you were mentioned.

Reply to this email directly or view it on GitHub https://github.com/Bookworm-project/BookwormDB/issues/102#issuecomment-216880176

jonathandfitzgerald commented 8 years ago

Thanks for this. Per @bmschmidt's suggestion, I looked into my field description file (which is a copy of Abby's) and found that I didn't have a searchstring item. I added one, but the click to view texts functionality still doesn't seem to work. The line I added looks like this:

{"datatype": "searchstring", "field": "text", "unique": true, "type": "text"},

Does that look right?

jonathandfitzgerald commented 8 years ago

This is weird. When I look at the jsoncatalog.txt file that is generated, it puts the "url" field into the searchstring, even though I specified the "text" field.

bmschmidt commented 8 years ago

Oh, you have to explicitly post the 'field' variable to be 'searchstring' as well, as in the example here: http://bookworm-project.github.io/Docs/field_descriptions.json.html. Otherwise, yeah, it takes "url" as the best alternative.

{"field":"searchstring","datatype":"searchstring","type":"text","unique":true}

On Wed, May 4, 2016 at 11:15 AM jonathandfitzgerald < notifications@github.com> wrote:

This is weird. When I look at the jsoncatalog.txt file that is generated, it puts the "url" field into the searchstring, even though I specified the "text" field.

— You are receiving this because you were mentioned.

Reply to this email directly or view it on GitHub https://github.com/Bookworm-project/BookwormDB/issues/102#issuecomment-216897406

jonathandfitzgerald commented 8 years ago

Okay, cool. I got it working. I added the line to the field description file, and found that there was a line in the text breaking python script that was assigning searchstring to url. So I fixed that. Thanks for your help!