Skip to content

Commit

Permalink
fixed DAO object not set, resulting in failed queries
Browse files Browse the repository at this point in the history
  • Loading branch information
albogdano committed Mar 13, 2022
1 parent 09d4742 commit 4e05d6f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ This plugin allows you to use Elasticsearch as the search engine for Para.

ES Plugin version | Elasticsearch support | OpenSearch support
--- | --- | ---
`1.40.0` and above | `7.10.x` and above **(with config flag)** | `1.0.0` and above **(with config flag)**
`1.40.0` and above | `8.x` and above **(with config flag)** | `1.0.0` and above **(with config flag)**
`1.39.0` and below | up to `7.15.2` | `1.0.0` and above

After version `1.40.0` a configuration flag is required to destinguish between the two different flavors of Eleasticsearch:
```ini
para.es.flavor = "elasticsearch"
# ==== OR ==== #
para.es.flavor = "openSearch"
para.es.flavor = "opensearch"
```
The default option here is `elasticsearch`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
public class ElasticSearch implements Search {

private static final Logger logger = LoggerFactory.getLogger(ElasticSearch.class);
private DAO dao;

/**
* Switch between OpenSearch and Elasticsearch flavors.
Expand All @@ -59,11 +58,6 @@ public class ElasticSearch implements Search {
static {
if (Para.getConfig().isSearchEnabled() && Para.getConfig().getConfigParam("search", "").
equalsIgnoreCase(ElasticSearch.class.getSimpleName())) {
if (OPEN_SEARCH_FLAVOR) {
OSUtils.getRESTClient();
} else {
ESUtils.getRESTClient();
}
// set up automatic index creation and deletion
App.addAppCreatedListener((App app) -> createIndexInternal(app));
App.addAppDeletedListener((App app) -> deleteIndexInternal(app));
Expand All @@ -83,7 +77,8 @@ public ElasticSearch() {
*/
@Inject
public ElasticSearch(DAO dao) {
this.dao = dao;
ES.setDao(dao);
OS.setDao(dao);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import com.erudika.para.server.search.ElasticSearch;
import static com.erudika.para.server.search.es.SearchTest.appid1;
import static com.erudika.para.server.search.es.SearchTest.u;
import com.erudika.para.server.search.es.ESUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
Expand Down

0 comments on commit 4e05d6f

Please sign in to comment.