
Java REST client for the SeekStorm vector & lexical search server.
seekstorm_client_java is open source licensed under the Apache License 2.0
Website | Benchmark | Demo | Repository for SeekStorm Python client | Repository for SeekStorm library, server, Rust client | Roadmap | Blog | X
mvn testimport com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.seekstorm.client.SeekStormClient;
import com.seekstorm.client.model.SearchRequest;
import com.seekstorm.client.model.SearchResponse;
import com.seekstorm.client.model.SchemaField;
import com.seekstorm.client.model.CreateIndexRequest;
import java.util.List;
ObjectMapper mapper = new ObjectMapper();
SeekStormClient client = SeekStormClient.builder()
.baseUrl("http://127.0.0.1:8080")
.apiKey("your-apikey")
.build();
String live = client.live();
System.out.println(live);
List<SchemaField> schema = List.of(
new SchemaField(
"title",
"Text",
true, // store
true, // index_lexical
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null
)
);
CreateIndexRequest createIndexRequest = new CreateIndexRequest("demo", schema);
long indexId = client.createIndex(createIndexRequest);
JsonNode document = mapper.createObjectNode()
.put("title", "hello seekstorm");
client.indexDocument(String.valueOf(indexId), document);
client.commitIndex(String.valueOf(indexId));
SearchRequest request = SearchRequest.builder("hello")
.length(5)
.build();
SearchResponse response = client.search(String.valueOf(indexId), request);
System.out.println("Total hits: " + response.countTotal());SeekStormClientis the synchronous entry point for REST calls.SearchRequestsupports lexical, vector, and hybrid query shapes and uses enum-backed fields for result type, query type, rewriting, and search mode. ThereturnDocumentsfield specifies what document information should be returned with search results.DocumentOptionencapsulates the options for returning documents in search results, including fields, distance fields, and highlights.CreateIndexRequestcontains the index name, schema, and nestedIndexConfigfor all indexing configuration.IndexConfiguses enum-backed fields for similarity, tokenizer, stemmer, compression, clustering, and inference.GetIteratorRequestis the iterator payload for paging through documents.GetDocumentRequestlets you request highlights, fields, and distance fields.ApiKeyQuotaRequestandDeleteApiKeyRequestare for API key lifecycle operations.SearchResponsecontains bothresults(always returned, doc ID and score only) anddocuments(returned only ifreturnDocumentswas specified in the request).SchemaFielddescribe index layout and field capabilities.
- Use the demo API key only for local development.
- Call
commitIndex(...)when you need durable results outside realtime search. - Use the raw
JsonNodeoverloads when you want to send server-specific payloads.