openlibrary icon indicating copy to clipboard operation
openlibrary copied to clipboard

Error editing Edition: Unable to add author

Open JeffKaplan opened this issue 7 years ago • 15 comments

Tried to add the author "Harry F. Olson" to https://openlibrary.org/books/OL24239544M/Elements_of_acoustical_engineering/edit and received error"expected /type/author, found /type/delete":

JeffKaplan avatar Apr 19 '19 21:04 JeffKaplan

That's due to a stale search index which is returning a deleted record. Try Harry Ferdinand Olson.

tfmorris avatar Apr 19 '19 22:04 tfmorris

I tried to reproduce this and ended up with the author that @tfmorris suggested, so it worked. I look at the number of works listed by each author in the drop down and choose the one with the most.

I think the error was occurring when https://openlibrary.org/authors/OL7017081A.json was selected, which is a delete type.

This is one reason redirects are better than deletes, but I think the error message was correct in this case. The stale search index is still a problem, but should there be a fix to make the messaging clearer?

Perhaps the dropdown should be filtered to remove redirects and deletes? I feel like this has been discussed before.

hornc avatar Apr 20 '19 03:04 hornc

@hornc What did you use for your search/autocomplete string?

I was able to reproduce Jeff's problem, which I should have stated up front, using his search string (ie with just the middle initial) and only a single choice was offered. Since then I merged a couple of the other author records and that apparently had the side effect of indexing the "Harry F." aka, so that it now is the top autocomplete option.

If you go to the second search option, you still see the same problem that Jeff reported.

As for filtering out deleted records goes, that's a good suggestion, but probably depends on the SOLR search results being accurate and not stale, which I suspect is not the case in this instance (but I didn't check directly).

tfmorris avatar Apr 22 '19 04:04 tfmorris

@tfmorris good question, I may have used "Harry Olson" to maximise my chances of finding the correct author by hoping to see all "Harry Olson"s , and if there was more than one, I'd pick the one with F. or Ferdinand. If I try again though, tying or pasting "Harry F. Olson" shows "Harry Ferdinand Olson" as the first option, followed by "Harry F. Olson"

hornc avatar Apr 30 '19 00:04 hornc

@hornc if this is not a bug, can you describe what needs to be done to close the issue?

brad2014 avatar May 13 '19 18:05 brad2014

I think there are two possible fixes for this issue:

  • Tidy up the reported error message to be more human readable OR (clearly better)
  • Filter results to ensure only direct author records are presented in the dropdown

(best) Longer term root cause fix is to ensure solr index is up to date and reflects the current state of all author records

hornc avatar Jun 04 '19 20:06 hornc

@cdrini, are you aware of an existing mechanism to check and filter the solr results to exclude redirects and deletes before they get passed to the UI?

I'm wondering if the fix here is simply to fix the indexing process, because what is the point of having Solr if all its results have to be individually checked for accuracy before being used?

hornc avatar Jun 13 '19 23:06 hornc

I'm wondering if the fix here is simply to fix the indexing process, because what is the point of having Solr if all its results have to be individually checked for accuracy before being used?

Congrats, @hornc, you've invented a Bloom Filter. :smile:

brad2014 avatar Jun 13 '19 23:06 brad2014

Solr shouldn't have redirects inside it, so you'd have to take the query results and load the live items from the database. This would probably be super not performant for something like autocomplete :/

cdrini avatar Jun 14 '19 02:06 cdrini

I think the ideal solution might be to follow the redirect. i.e. If I try to set an author to be a redirect, it should set it to be the direct value.

In the case of a deletion, a better error message.

cdrini avatar Jun 14 '19 02:06 cdrini

@hornc There hasn't been progress on this in 4 months so I'm labeling it as backlogged. Let me know your thoughts.

@tapaswenipathak Feel free to fork and take a stab at solving this issue and reporting back in this thread.

xayhewalo avatar Oct 20 '19 00:10 xayhewalo

Related or duplicate of https://github.com/internetarchive/openlibrary/issues/1445?

seabelis avatar Oct 20 '19 14:10 seabelis

They both seem to be related to /type/redirect/ but I don't see mention of /type/direct in #1445 so perhaps they are different issues. I'm not too sure though

xayhewalo avatar Oct 21 '19 00:10 xayhewalo

Thanks @seabelis , I think you are correct that this will be at least improved by #1445

From re-reading this thread, I think the immediate fix and task to resolve the issue as reported is to filter out /type/delete's and /type/redirect`s from the author auto-complete drop-down. code @ https://github.com/internetarchive/openlibrary/blob/master/openlibrary/templates/books/author-autocomplete.html @tapaswenipathak if you still are able to take a look at the js here that would be super helpful!

hornc avatar Nov 07 '19 21:11 hornc

This issue is a very specific error: A specific book could not be edited. The book record looks correct.

It's unclear what someone would do to close this issue. If we need a more specific issue created, let's please do so. I'm going to close @JeffKaplan's ticket (the thread preserves the context).

mekarpeles avatar Dec 13 '19 00:12 mekarpeles