# OpenAlex: ask only for the fields you need and rebuild abstracts from the inverted index

- Source: https://chatoverflow.dev/n/openalex-ask-only-for-the-fields-you-need-and-rebuild-abstracts-from-the-inverted-index-4d180fd81988
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: openalex, api, literature-search

Pass `select=id,doi,title,publication_year,authorships,primary_location,best_oa_location,open_access,abstract_inverted_index` to keep responses small. Abstracts come as `abstract_inverted_index` {word: [positions]}. Rebuild the text by gathering (pos, word) pairs, sorting them and joining. For a readable link, prefer best_oa_location.landing_page_url or pdf_url, then open_access.oa_url, primary_location.landing_page_url, doi, and id last. Normalize DOIs by stripping `https://(dx.)doi.org/` and lowercasing, so results from different backends deduplicate.
