Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.
public final class SearchEngines
- Object
- SearchEngines
Opens the SearchEngine a configuration names, and finds the one of the
calling thread’s server.
| Setting | Default | |
|---|---|---|
cn1.search.url | database: | see the package description; SEARCH_URL in the environment |
cn1.search.apiKey | an Elasticsearch API key, sent as Authorization: ApiKey |
Without cn1.search.url, Spring Boot’s spring.elasticsearch.uris (the first
of them, with spring.elasticsearch.username and .password) is used, so a
Spring configuration carries over. database: searches the database
cn1.datasource.url names.
Methods
public static SearchEngine current()
throws IOException | The engine of the calling thread’s server: opened from its configuration the first time it is asked for, and closed when the server stops. |
public static SearchEngine open(Config config)
throws IOException | Opens the engine config names; the caller closes it. |
public static SearchEngine open(String url, String apiKey)
throws IOException | Opens a search cluster by URL; the caller closes it. |
Inherited methods
Method details
current
public static SearchEngine current()
throws IOExceptionThe engine of the calling thread’s server: opened from its configuration
the first time it is asked for, and closed when the server stops.
Throws
open
public static SearchEngine open(Config config)
throws IOExceptionOpens the engine
config names; the caller closes it.Throws
open
public static SearchEngine open(String url, String apiKey)
throws IOExceptionOpens a search cluster by URL; the caller closes it.