Search
Search papers
Search the content of every paper in your workspace.
Search looks through the content of all processed papers in your workspace and returns the passages that match.
Search
const { items } = await paperful.search.query("quarterly revenue growth");
for (const result of items) {
console.log(result.paper.fileName, result.score);
console.log(result.content);
} Each result includes:
| Field | Description |
|---|---|
content | The matching passage. |
score | How relevant the result is. |
paper | The paper the passage belongs to. |
nodes | The nodes the passage came from, with their pages. |
matches | The matched terms and where they appear in the passage. |
To expand a result into the content around it, see Search to context.
Choose a search mode
const { items } = await paperful.search.query("revenue",
{
mode: "fulltext",
}
); | Mode | Description |
|---|---|
hybrid | Combines keyword and semantic search. The default. |
fulltext | Matches the exact words in your query. |
semantic | Matches by meaning, even when the words differ. |