Install the Vespa command-line tool to interact with Vespa instances:
brew install vespa-cli
Verify the installation:
vespa version
2
Create Your First Application
Create a new Vespa application package with a schema definition:
mkdir my-app && cd my-appmkdir -p schemas
Create a schema file schemas/music.sd:
schemas/music.sd
schema music { document music { field artist type string { indexing: summary | index } field title type string { indexing: summary | index } field year type int { indexing: summary | attribute } }}
3
Deploy and Feed Data
Deploy the application locally using Docker:
vespa deploy --wait 300
Feed a document to your application:
vespa document put id:music:music::1 '{ "fields": { "artist": "The Beatles", "title": "Hey Jude", "year": 1968 }}'
4
Query Your Data
Search for documents using the Query API:
vespa query 'select * from music where title contains "jude"'