Class RequestToElasticsearch
- java.lang.Object
-
- fr.gouv.vitam.common.database.translators.RequestToAbstract
-
- fr.gouv.vitam.common.database.translators.elasticsearch.RequestToElasticsearch
-
- Direct Known Subclasses:
SelectToElasticsearch
public abstract class RequestToElasticsearch extends RequestToAbstract
Request To Elasticsearch
-
-
Field Summary
-
Fields inherited from class fr.gouv.vitam.common.database.translators.RequestToAbstract
requestParser
-
-
Constructor Summary
Constructors Constructor Description RequestToElasticsearch(AbstractParser<?> requestParser)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.elasticsearch.index.query.QueryBuilder
getInitialRoots(java.lang.String field)
Additional filter to first requestorg.elasticsearch.index.query.QueryBuilder
getNthQueries(int nth, VarNameAdapter adapter, DynamicParserTokens parserTokens)
find(query)org.elasticsearch.index.query.QueryBuilder
getRequest(org.elasticsearch.index.query.QueryBuilder roots, org.elasticsearch.index.query.QueryBuilder query)
static RequestToElasticsearch
getRequestToElasticsearch(AbstractParser<?> requestParser)
Create the RequestToElasticsearch adapted to the RequestParser-
Methods inherited from class fr.gouv.vitam.common.database.translators.RequestToAbstract
getFinalLimit, getFinalOffset, getHints, getLastDepth, getNbQueries, getNthQuery, getRequest, getRequestParser, getUsage, hasFullTextQuery, hintCache, hintNoTimeout, isMultiple, model
-
-
-
-
Constructor Detail
-
RequestToElasticsearch
public RequestToElasticsearch(AbstractParser<?> requestParser)
- Parameters:
requestParser
- AbstractParser of unknown type
-
-
Method Detail
-
getRequestToElasticsearch
public static RequestToElasticsearch getRequestToElasticsearch(AbstractParser<?> requestParser) throws VitamException
Create the RequestToElasticsearch adapted to the RequestParser- Parameters:
requestParser
- AbstractParser of unknown type- Returns:
- the associated RequestToElasticsearch
- Throws:
VitamException
- the type of request is not select
-
getInitialRoots
public org.elasticsearch.index.query.QueryBuilder getInitialRoots(java.lang.String field) throws InvalidParseOperationException
Additional filter to first request- Parameters:
field
- Field from which the proposed values shall be found- Returns:
- the filter associated with the initial roots
- Throws:
InvalidParseOperationException
- if field could not parse to JSON
-
getRequest
public org.elasticsearch.index.query.QueryBuilder getRequest(org.elasticsearch.index.query.QueryBuilder roots, org.elasticsearch.index.query.QueryBuilder query)
- Parameters:
roots
- QueryBuilderquery
- QueryBuilder- Returns:
- the final request
-
getNthQueries
public org.elasticsearch.index.query.QueryBuilder getNthQueries(int nth, VarNameAdapter adapter, DynamicParserTokens parserTokens) throws java.lang.IllegalAccessError, InvalidParseOperationException
find(query)- Parameters:
nth
- intparserTokens
- DynamicParserTokens- Returns:
- the associated query for find (missing the source however, as initialRoots)
- Throws:
java.lang.IllegalAccessError
- if nth exceed the size of listInvalidParseOperationException
- if could not get command by query
-
-