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

Autocomplete endpoint only queries name, not labels #338

Open
skurzinz opened this issue Jul 7, 2022 · 17 comments
Open

Autocomplete endpoint only queries name, not labels #338

skurzinz opened this issue Jul 7, 2022 · 17 comments
Assignees

Comments

@skurzinz
Copy link
Contributor

skurzinz commented Jul 7, 2022

@sviatoplok noted that

Contrary to what the Web GUI "name or label" search box does, the autocomplete endpoint does not return entites with a label.

https://mpr.acdh.oeaw.ac.at/apis/entities/autocomplete/place/?term=bodenbach&q=bodenbach&_type=query only returns external GeoNames entities

https://mpr.acdh.oeaw.ac.at/apis/entities/autocomplete/place/?term=podmokly&q=podmokly&_type=query returns the entity that is already stored in the MPR and has the label "Bodenbach".

Expected behaviour:

https://mpr.acdh.oeaw.ac.at/apis/entities/autocomplete/place/?term=bodenbach&q=bodenbach&_type=query should return https://mpr.acdh.oeaw.ac.at/entity/7431

As the "name or label" search box already shows this behaviour I suspect this could be easily achieved.

@sviatoplok
Copy link

sviatoplok commented Jul 12, 2022

The same happens with:

Places

  • Italien
  • Russland
  • Serbien
  • Wien
  • Vorarlberg

Persons

  • Leth, Karl

@sviatoplok
Copy link

In the case of persons, d-nb database entries are being returned

@sviatoplok
Copy link

The problem also occurs when linking

  • Kaiserlich-Königliche Staats-Oberrealschule (Laibach)

@sennierer sennierer self-assigned this Jul 13, 2022
@sennierer
Copy link
Collaborator

yes, that should be easy to fix. we are on it.

@sviatoplok
Copy link

bitte melden, wenn fertig, dann kann ich mit dem copypasten aufhören

@skurzinz
Copy link
Contributor Author

skurzinz commented Jul 13, 2022 via email

@sviatoplok
Copy link

Also in the relations UI the entity search does not find labels.
"Laibach" finds the geonames entries called Laibach, but not the db entry called Ljubljana.

@sviatoplok
Copy link

Now it also happened with an institution:

Handelsministerium

@sviatoplok
Copy link

Persenbeug

@sviatoplok
Copy link

Deutsches Reich
Wien

@sviatoplok
Copy link

Bregenz

@sviatoplok
Copy link

sviatoplok commented Jul 26, 2022

Interessant auch UNGARN:

die URL hat die ID drin, die URI ist aber anders und eine weitere MPR-URI gibt es nicht:

grafik

++++++++++++++++++++++

grafik

@sviatoplok
Copy link

Interessant auch UNGARN:

die URL hat die ID drin, die URI ist aber anders und eine weitere MPR-URI gibt es nicht:

grafik

++++++++++++++++++++++

grafik

detto Arbeitsministerium, Eisenbahnministerium

@sviatoplok
Copy link

sviatoplok commented Jul 29, 2022

Derselbe Ärger wegen falscher URLs mit

Kärnten
[Generaldirektion des Grundsteuerkatasters]
[Finanzlandesdirektion in Graz](

@sviatoplok
Copy link

ebenso Statthalterei Prag

@sviatoplok
Copy link

Abgeordnetenhaus

Sozialdemokratische Arbeiterpartei

@richardhadden
Copy link

Should be fixed by changing APIS_ENTITIES.<entity>.search in settings/base.py. Labels are a related entity, so should be added as label__label, e.g.

 "Place": {
        "merge": True,
        "search": ["name", "label__label"],
         ...
 }

This has been done for settings/base.py in apis-devops repository: acdh-oeaw/apis-devops#1

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

4 participants