boostcampwm-2022 / web18-PRV

논문 인용관계를 밤하늘의 별 처럼 표시해보자 🌟-🌟
https://paperef.com
146 stars 3 forks source link

검색 결과 데이터가 rows 갯수보다 적거나 아예 없는 현상 #73

Closed Palwol closed 1 year ago

Palwol commented 1 year ago

이슈 내용

기대 결과

leesungbin commented 1 year ago

viewpoint로 검색했을 때, 첫페이지는 아래와 같은 정보가 나오는군용 url: https://api.crossref.org/works?query=viewpoint&select=title,author

{
  "status": "ok",
  "message-type": "work-list",
  "message-version": "1.0.0",
  "message": {
    "facets": {},
    "total-results": 26925,
    "items": [
      {
        "title": ["Pacific Viewpoint"]
      },
      {
        "title": ["Introducing Pacific Viewpoint"],
        "author": [
          {
            "family": "The Editor",
            "sequence": "first",
            "affiliation": []
          }
        ]
      },
      {
        "title": ["Pacific Viewpoint: Twenty­Five Years On"]
      },
      {
        "title": ["Refashioning a Pacific Viewpoint"],
        "author": [
          {
            "given": "Overton",
            "family": "John",
            "sequence": "first",
            "affiliation": [
              {
                "name": "Institute of Development Studies, Massey University"
              }
            ]
          },
          {
            "given": "Roche",
            "family": "Michael",
            "sequence": "additional",
            "affiliation": [
              {
                "name": "Department of Geography at Massey University"
              }
            ]
          }
        ]
      },
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {},
      {}
    ],
    "items-per-page": 20,
    "query": {
      "start-index": 0,
      "search-terms": "viewpoint"
    }
  }
}
leesungbin commented 1 year ago

즉, title이 없는 정보에 대해 filter를 걸다보니, page별로 아예 정보가 없을 수도 있는 상황이네요~

이 문제를 해결하려면,, 2가지정도 방법이 있을 것 같아요.

  1. 적절한 row 개수가 채워질 때 까지 offset을 변경해가며 요청을 보낸다
    • 페이지네이션 로직이 괴물이 될 것 같아요
  2. /search 할 때는 우리 서비스의 db만 조회하고, db에 논문정보를 집어넣을 때, 적절한 논문(title이 있는)만 집어넣는다.
    • 우리 db에 정보가 별로 없다면 사용자는 정보를 보지 못할 수도 있어요.
leesungbin commented 1 year ago