Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • clients/cesium-grp/cesium-plus-pod
  • clients/java/duniter4j
  • ji_emme/duniter4j
  • dvermd/cesium-plus-pod
  • okayotanoka/cesium-plus-pod
  • pokapow/cesium-plus-pod
  • pini-gh/cesium-plus-pod
7 results
Show changes
Showing
with 911 additions and 0 deletions
<?xml version="1.0" encoding="UTF-8"?>
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>full-windows-i586</id>
<formats>
<format>zip</format>
</formats>
<componentDescriptors>
<componentDescriptor>
src/main/assembly/full-windows-component.xml
</componentDescriptor>
</componentDescriptors>
<fileSets>
<fileSet>
<directory>${project.build.directory}/jre-windows-i586/jre</directory>
<outputDirectory>jre</outputDirectory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
<?xml version="1.0" encoding="UTF-8"?>
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>full-windows-x64</id>
<formats>
<format>zip</format>
</formats>
<componentDescriptors>
<componentDescriptor>
src/main/assembly/full-windows-component.xml
</componentDescriptor>
</componentDescriptors>
<fileSets>
<fileSet>
<directory>${project.build.directory}/jre-windows-x64/jre</directory>
<outputDirectory>jre</outputDirectory>
<includes>
<include>**/*</include>
</includes>
</fileSet>
</fileSets>
</assembly>
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>i18n</id>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<directory>target/classes/META-INF</directory>
<outputDirectory/>
<includes>
<include>duniter4j-client-i18n*.properties</include>
<include>duniter4j-client-i18n*.csv</include>
</includes>
</fileSet>
<fileSet>
<directory>src/main/assembly/min</directory>
<outputDirectory/>
<filtered>true</filtered>
<includes>
<include>version.appup</include>
</includes>
</fileSet>
</fileSets>
</assembly>
-----------------------------
-- README Duniter4j Client --
-----------------------------
# Linux
./duniter4j.sh <command> <options>
# Windows
duniter4j.bat <command> <options>
Need HELP ?
-----------
# Linux
./duniter4j.sh --help
# Windows
duniter4j.bar --help
\ No newline at end of file
# --------------------------------------
# Duniter4j Client Configuration file
# --------------------------------------
#
# Duniter node
#
duniter4j.node.host=g1.duniter.org
duniter4j.node.port=10901
#
# Cesium+ node (aka Duniter4j-Elasticsearch)
#
duniter4j.node.elasticsearch.host=g1.data.duniter.fr
duniter4j.node.elasticsearch.port=443
@echo off
set OLDDIR=%CD%
cd /d %~dp0%
set DUNITER4j_BASEDIR="%CD%"
set JAVA_HOME=%DUNITER4j_BASEDIR%\jre
set JAVA_COMMAND=%JAVA_HOME%\bin\java
set DUNITER4j_CONFIG_DIR=%DUNITER4j_BASEDIR%\config
echo "Running Duniter4j Client..."
echo " basedir: %DUNITER4j_BASEDIR%"
echo " jre home: %JAVA_HOME%"
:start
call duniter4j\launch.bat --option duniter4j.launch.mode full --option duniter4j.basedir %DUNITER4j_BASEDIR% --option config.path %DUNITER4j_CONFIG_DIR%
if errorlevel 88 goto start
goto quit
:quit
cd %OLDDIR%
#!/bin/bash
READLINK=`which readlink`
if [[ -z "$READLINK" ]]; then
message "Required tool 'readlink' is missing. Please install before launch \"$0\" file."
exit 1
fi
# ------------------------------------------------------------------
# Ensure BASEDIR points to the directory where the soft is installed.
# ------------------------------------------------------------------
SCRIPT_LOCATION=$0
if [[ -x "$READLINK" ]]; then
while [[ -L "$SCRIPT_LOCATION" ]]; do
SCRIPT_LOCATION=`"$READLINK" -e "$SCRIPT_LOCATION"`
done
fi
export APPDIR=`dirname "$SCRIPT_LOCATION"`
export JARDIR="$APPDIR/duniter4j"
export JAR="$JARDIR/${project.build.finalName}.${project.packaging}"
export I18N_DIR="$APPDIR/i18n"
# Retrieve the JAVA installation
if [[ "$JAVA_HOME~" == "~" ]]; then
export JAVA_HOME="$APPDIR/jre"
export JAVA_COMMAND="$JAVA_HOME/bin/java"
if [[ -f "$JAVA_HOME/bin/java" ]]; then
# If embedded JRE exists, make sure java is executable
chmod +x "$JAVA_COMMAND"
else
# If not Embedded JRE, use the default binary
export JAVA_COMMAND=java
fi
else
export JAVA_COMMAND="$JAVA_HOME/bin/java"
fi
if [[ -d "$HOME" ]]; then
export BASEDIR="$HOME/.config/duniter4j"
export CONFIG_DIR="$BASEDIR/config"
export CONFIG_FILE="$CONFIG_DIR/duniter4j-client.config"
export LOG_FILE="$BASEDIR/logs/${project.build.finalName}.log"
else
export BASEDIR="$APPDIR"
export CONFIG_DIR="$APPDIR/config"
export CONFIG_FILE="$CONFIG_DIR/config/duniter4j-client.config"
export LOG_FILE="$APPDIR/logs/${project.build.finalName}.log"
echo "Using basedir: $APPDIR"
fi
if [[ "$JAVA_OPTS~" == "~" ]]; then
# Configuring apache simplelog to use Log4j
JAVA_OPTS="-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger"
exprt ${JAVA_OPTS}
fi
# Create the config dir if need
mkdir -p "$CONFIG_DIR"
# Create the config file (if need)
if [[ ! -f "$CONFIG_FILE" ]]; then
echo "INFO - Initialized configuration file: $CONFIG_FILE"
cp -u $JARDIR/duniter4j-client.config $CONFIG_FILE
fi
cd $APPDIR
while true; do
$JAVA_COMMAND $JAVA_OPTS -Dduniter4j.log.file=$LOG_FILE -Dduniter4j.i18n.directory=$I18N_DIR -jar $JAR --basedir $BASEDIR --config $CONFIG_FILE $*
exitcode=$?
if [[ ! "$exitcode" -eq "130" ]]; then
echo "INFO - Application stopped with exitcode: $exitcode"
fi
## Continue only if exitcode=88 (will restart the application)
if [[ ! "$exitcode" -eq "88" ]]; then
# quit now!
exit $exitcode
fi
done
${project.version}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>standalone</id>
<formats>
<format>zip</format>
</formats>
<fileSets>
<fileSet>
<directory>target</directory>
<outputDirectory/>
<includes>
<include>${project.build.finalName}.${project.packaging}</include>
</includes>
</fileSet>
<fileSet>
<directory>target/lib</directory>
<outputDirectory>lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
<excludes>
<exclude>junit-*.jar</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>src/main/assembly/full</directory>
<outputDirectory/>
<filtered>true</filtered>
<includes>
<include>*.sh</include>
<include>*.bat</include>
</includes>
</fileSet>
<fileSet>
<directory>src/main/assembly/min</directory>
<outputDirectory/>
<filtered>true</filtered>
<includes>
<include>version.appup</include>
</includes>
</fileSet>
<fileSet>
<includes>
<include>README*</include>
<include>LICENSE*</include>
</includes>
</fileSet>
<!--add basic configuration-->
<fileSet>
<directory>src/main/assembly/min</directory>
<outputDirectory>config</outputDirectory>
<includes>
<include>duniter4j-client.config</include>
</includes>
</fileSet>
</fileSets>
</assembly>
package org.duniter.elasticsearch.client.model.filter;
/*-
* #%L
* Cesium+ pod :: Client API
* %%
* Copyright (C) 2014 - 2023 Duniter Team
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
import lombok.Builder;
import lombok.Data;
import org.duniter.elasticsearch.client.model.geom.Envelope;
import java.util.Date;
@Data
@Builder
public class MovementFilter {
public static MovementFilter nullToEmpty(MovementFilter filter) {
return filter != null ? filter : MovementFilter.builder().build();
}
@Builder.Default
private Date startDate = null;
@Builder.Default
private Date endDate = null;
@Builder.Default
private String pubkey = null;
@Builder.Default
private String[] issuers = null;
@Builder.Default
private String[] recipients = null;
@Builder.Default
private String[] fields = null;
@Builder.Default
private String queryString = null;
}
package org.duniter.elasticsearch.client.model.filter;
/*-
* #%L
* Cesium+ pod :: Client API
* %%
* Copyright (C) 2014 - 2023 Duniter Team
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.duniter.elasticsearch.client.model.geom.Envelope;
import java.util.Date;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class UserProfileFilter {
public static UserProfileFilter nullToEmpty(UserProfileFilter filter) {
return filter != null ? filter : UserProfileFilter.builder().build();
}
@Builder.Default
private Date startDate = null;
@Builder.Default
private Date endDate = null;
@Builder.Default
private Envelope boundingBox = null;
@Builder.Default
private String[] fields = null;
@Builder.Default
private String queryString = null;
@Builder.Default
private String[] issuers = null;
}
package org.duniter.elasticsearch.client.model.filter;
/*-
* #%L
* Cesium+ pod :: Client API
* %%
* Copyright (C) 2014 - 2023 Duniter Team
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.duniter.elasticsearch.client.model.geom.Envelope;
import java.util.Date;
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class UserSettingsFilter {
public static UserSettingsFilter nullToEmpty(UserSettingsFilter filter) {
return filter != null ? filter : UserSettingsFilter.builder().build();
}
@Builder.Default
private Date startDate = null;
@Builder.Default
private Date endDate = null;
@Builder.Default
private String[] fields = null;
@Builder.Default
private String queryString = null;
@Builder.Default
private String[] issuers = null;
}
package org.duniter.elasticsearch.client.model.geom;
/*-
* #%L
* Cesium+ pod :: Client API
* %%
* Copyright (C) 2014 - 2023 Duniter Team
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@Builder
public class Envelope {
private double minX;
private double minY;
private double maxX;
private double maxY;
public Envelope(double minX, double minY, double maxX, double maxY) {
if (minX > maxX || minY > maxY) {
this.minX = Double.NaN;
this.minY = Double.NaN;
this.maxX = Double.NaN;
this.maxY = Double.NaN;
} else {
this.minX = minX;
this.minY = minY;
this.maxX = maxX;
this.maxY = maxY;
}
}
}
package org.duniter.elasticsearch.client.model.query;
/*-
* #%L
* Cesium+ pod :: Client API
* %%
* Copyright (C) 2014 - 2023 Duniter Team
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Builder;
import lombok.Data;
@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class BoolQuery {
SearchQuery[] must;
SearchQuery[] filter;
SearchQuery[] should;
SearchQuery[] mustNot;
Integer minimumShouldMatch;
Integer boost;
@JsonGetter("minimum_should_match")
public Integer getMinimumShouldMatch() {
return minimumShouldMatch;
}
@JsonGetter("must_not")
public SearchQuery[] getMustNot() {
return mustNot;
}
}
package org.duniter.elasticsearch.client.model.query;
/*-
* #%L
* Cesium+ pod :: Client API
* %%
* Copyright (C) 2014 - 2023 Duniter Team
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Builder;
import lombok.Data;
@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class ConstantScoreQuery {
SearchQuery[] must;
SearchQuery[] filter;
SearchQuery[] should;
SearchQuery[] mustNot;
Integer minimumShouldMatch;
Integer boost;
@JsonGetter("minimum_should_match")
public Integer getMinimumShouldMatch() {
return minimumShouldMatch;
}
@JsonGetter("must_not")
public SearchQuery[] getMustNot() {
return mustNot;
}
}
package org.duniter.elasticsearch.client.model.query;
/*-
* #%L
* Cesium+ pod :: Client API
* %%
* Copyright (C) 2014 - 2023 Duniter Team
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
import com.fasterxml.jackson.annotation.JsonGetter;
import lombok.Builder;
import lombok.Data;
@Data
@Builder
public class ExistsQuery {
private String field;
}
package org.duniter.elasticsearch.client.model.query;
/*-
* #%L
* Cesium+ pod :: Client API
* %%
* Copyright (C) 2014 - 2023 Duniter Team
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import org.duniter.elasticsearch.model.type.GeoPoint;
@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public class GeoBoundingBoxQuery {
private BoundingBox geoPoint;
@Data
@Builder
@AllArgsConstructor
public static class BoundingBox {
private GeoPoint topLeft;
private GeoPoint bottomRight;
@JsonGetter("top_left")
public GeoPoint getTopLeft() {
return topLeft;
}
@JsonGetter("bottom_right")
public GeoPoint getBottomRight() {
return bottomRight;
}
}
}
package org.duniter.elasticsearch.client.model.query;
/*-
* #%L
* Cesium+ pod :: Client API
* %%
* Copyright (C) 2014 - 2023 Duniter Team
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
import com.fasterxml.jackson.annotation.JsonGetter;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Builder;
import lombok.Data;
@Data
@Builder
public class QueryString {
private String query;
@JsonInclude(JsonInclude.Include.NON_EMPTY)
private String[] fields;
@JsonInclude(JsonInclude.Include.NON_NULL)
private String defaultField;
@JsonGetter("default_field")
public String getDefaultField() {
return defaultField;
}
}
package org.duniter.elasticsearch.client.model.query;
/*-
* #%L
* Cesium+ pod :: Client API
* %%
* Copyright (C) 2014 - 2023 Duniter Team
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Builder;
import lombok.Data;
@Data
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public class RangePartQuery {
private Number gte;
private Number gt;
private Number lt;
private Number lte;
}
package org.duniter.elasticsearch.client.model.query;
/*-
* #%L
* Cesium+ pod :: Client API
* %%
* Copyright (C) 2014 - 2023 Duniter Team
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* #L%
*/
import com.google.common.collect.ImmutableMap;
import org.duniter.elasticsearch.client.model.geom.Envelope;
import org.duniter.elasticsearch.model.type.GeoPoint;
public class SearchQueries {
public static SearchQuery queryString(String query) {
return SearchQuery.builder()
.queryString(QueryString.builder()
.query(query)
.build()
).build();
}
public static SearchQuery geoBoundingBox(Envelope bbox) {
return SearchQuery.builder()
.geoBoundingBox(GeoBoundingBoxQuery.builder()
.geoPoint(GeoBoundingBoxQuery.BoundingBox.builder()
.topLeft(GeoPoint.builder()
.lat(Math.max(bbox.getMaxY(), bbox.getMinY()))
.lon(Math.min(bbox.getMinX(), bbox.getMaxX()))
.build())
.bottomRight(GeoPoint.builder()
.lat(Math.min(bbox.getMaxY(), bbox.getMinY()))
.lon(Math.max(bbox.getMinX(), bbox.getMaxX()))
.build())
.build())
.build())
.build();
}
public static SearchQuery match(String field, String value) {
return SearchQuery.builder()
.match(ImmutableMap.of(field, value))
.build();
}
public static SearchQuery matchPhrase(String field, String value) {
return SearchQuery.builder()
.matchPhrase(ImmutableMap.of(field, value))
.build();
}
public static SearchQuery matchPhrasePrefix(String field, String value) {
return SearchQuery.builder()
.matchPhrasePrefix(ImmutableMap.of(field, value))
.build();
}
public static SearchQuery term(String field, String term) {
return SearchQuery.builder()
.term(ImmutableMap.of(field, term))
.build();
}
public static SearchQuery terms(String field, String... terms) {
return SearchQuery.builder()
.terms(ImmutableMap.of(field, terms))
.build();
}
public static SearchQuery exists(String field) {
return SearchQuery.builder()
.exists(ExistsQuery.builder().field(field).build())
.build();
}
public static SearchQuery range(String field, RangePartQuery range) {
return SearchQuery.builder()
.range(ImmutableMap.of(field, range))
.build();
}
}