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

Refactor inconsistent and confusing search/listing endpoints and views. #5818

Open
deiferni opened this issue Jul 11, 2019 · 0 comments
Open
Labels
API api-change PBI Sprint PBI (Product Backlog Item) Solr validate

Comments

@deiferni
Copy link
Contributor

deiferni commented Jul 11, 2019

Currently we provide quite a bunch of different search/listing API endpoints and views for searching. Some of them transparently use SOLR, if it is available, some of them always use the catalog.

We need to discuss which of them are needed, and what could/should be refactored. Figuring out use-cases is key. Potential Goals/Discussion Items:

  • Unify request API
  • Unify result/response structure
  • Make clear when SOLR is used and when we use the catalog

This is a list of endpoints/views:

{
  "@id": "http://localhost:8080/fd/ordnungssystem/fuehrung/dossier-23/@listing?name=documents&columns%3Alist=title&columns%3Alist=modified&columns%3Alist=filesize",
  "b_size": 25,
  "b_start": 0,
  "items": [
    {
      "@id": "http://localhost:8080/fd//ordnungssystem/fuehrung/dossier-23/document-59",
      "filesize": 12303,
      "modified": "2019-03-11T13:50:14+00:00",
      "title": "Ein Brief"
    }
  ],
  "items_total": 1
}
[
    {
        "Description": "",
        "Title": "Lorem ipsum dolor",
        "UID": "97d068586e2447479704a7835b547437",
        "path": "/fd/sitzungen/committee-1/submitted-proposal-151/document-29"
    }
]
{
    "@id": "http://localhost:8080/fd/ordnungssystem/fuehrung/kommunikation/allgemeines/dossier-1/@search?SearchableText=lorem",
    "items": [
        {
            "@id": "http://localhost:8080/fd/ordnungssystem/fuehrung/kommunikation/allgemeines/dossier-1",
            "@type": "opengever.dossier.businesscasedossier",
            "description": "",
            "review_state": "dossier-state-active",
            "title": "Jahresdossier 2014"
        }
    ],
    "items_total": 1
}
  • @livesearch implemented in the GeverLiveSearchGet class in https://github.com/4teamwork/opengever.core/blob/master/opengever/api/livesearch.py#L8
    • Transparently uses SOLR when available, portal_catalog otherwise. In case of SOLR re-uses opengever.base.browserlivesearch.LiveSearchReplyView. In case of catalog reuses plone.restapi.services.SearchGet.
    • Couldn't find documentation
    • Not scoped by context
    • Returns a list of queried objects without query metadata as following:
[
    {
        "@id": "http://localhost:8080/fd/ordnungssystem/gesellschaftliches/dossier-28/document-48",
        "@type": "opengever.document.document",
        "filename": "Kopie von lorem.docx",
        "title": "Kopie von lorem"
    }
]
@deiferni deiferni added API Solr api-change PBI Sprint PBI (Product Backlog Item) labels Jul 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API api-change PBI Sprint PBI (Product Backlog Item) Solr validate
Projects
None yet
Development

No branches or pull requests

1 participant