Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View all the documents loaded into vespa

Tags:

vespa

Is there any way to fetch all the documents loaded into vespa?

I tried querying with regular expressions, but it didn't work as expected.

select * from entity where ID matches "[.]+";

ID is not an attribute, but I tried with an attribute field, both didn't respond with any values.

like image 625
Raghu Venmarathoor Avatar asked Jan 27 '23 20:01

Raghu Venmarathoor


1 Answers

Using visiting instead of search, either with the vespa-visit tool or using visiting in the document/v1 REST API is usually preferable for dumping documents.

If you want to use search, use this query to match all documents of a type:

select * from yourdocumenttype where sddocname contains 'yourdocumenttype';

To iterate over all documents with this, it will be more efficient to use a some field in your document to partition the document set into smaller chunks and query for one chunk at a time (e.g if you have a timestamp field, add a range condition to the query to retrieve documents for a slice of time in each query).

(Regular expressions are only supported in streaming mode.)

like image 153
Jon Avatar answered Mar 16 '23 03:03

Jon