Skip to content

Commit

Permalink
Updated to ElasticGeo 2.16.1 which resolves an issue with threads not…
Browse files Browse the repository at this point in the history
… being released introduced with #259.

Added datastore disposal around the keyword query.
  • Loading branch information
dclemenzi committed Jul 24, 2020
1 parent ef13703 commit 7c2be55
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Coalesce.Framework.Persistance/elasticsearch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<properties>
<ironhide.version>2.0.4</ironhide.version>
<elasticsearch.version>7.4.2</elasticsearch.version>
<elasticgeo.version>2.16.0-INC</elasticgeo.version>
<elasticgeo.version>2.16.1-INC</elasticgeo.version>
</properties>

<modules>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,20 +105,30 @@ private Set<String> getKeywords(String index, String type) throws CoalescePersis
try
{
DataStore datastore = getDataStore(index);
SimpleFeatureType feature = datastore.getSchema(index);

for (AttributeDescriptor attr : feature.getAttributeDescriptors())
try
{
if (!attr.getLocalName().startsWith("_"))
{
Object value = attr.getUserData().getOrDefault("analyzed", Boolean.FALSE);
SimpleFeatureType feature = datastore.getSchema(index);

if (value instanceof Boolean && !((Boolean) value))
for (AttributeDescriptor attr : feature.getAttributeDescriptors())
{
if (!attr.getLocalName().startsWith("_"))
{
keywords.add(attr.getLocalName());
Object value = attr.getUserData().getOrDefault("analyzed", Boolean.FALSE);

if (value instanceof Boolean && !((Boolean) value))
{
keywords.add(attr.getLocalName());
}
}
}
}
finally
{
if (!isDataStoreCacheEnabled())
{
datastore.dispose();
}
}
}
catch (IOException | RuntimeException e)
{
Expand Down

0 comments on commit 7c2be55

Please sign in to comment.