Class ElasticDocQueryContext

  • All Implemented Interfaces:
    io.ebeaninternal.server.expression.DocQueryContext

    public class ElasticDocQueryContext
    extends Object
    implements io.ebeaninternal.server.expression.DocQueryContext
    Context for writing elastic search expressions.
    • Method Detail

      • asJson

        public static String asJson​(ElasticJsonContext context,
                                    io.ebeaninternal.api.SpiQuery<?> query)
        Return the query in ElasticSearch JSON form.
      • getExpressionPath

        public io.ebean.plugin.ExpressionPath getExpressionPath​(String propName)
        Specified by:
        getExpressionPath in interface io.ebeaninternal.server.expression.DocQueryContext
      • startBool

        public void startBool​(io.ebean.Junction.Type type)
                       throws IOException
        Start Bool expression.
        Specified by:
        startBool in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • startBoolMust

        public void startBoolMust()
                           throws IOException
        Start Bool MUST.
        Specified by:
        startBoolMust in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • startBoolMustNot

        public void startBoolMustNot()
                              throws IOException
        Start Bool MUST_NOT.
        Specified by:
        startBoolMustNot in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • startBoolGroup

        public void startBoolGroup()
                            throws IOException
        Start a Bool which could contain a MUST, SHOULD or MUST_NOT.
        Specified by:
        startBoolGroup in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • startBoolGroupList

        public void startBoolGroupList​(io.ebean.Junction.Type type)
                                throws IOException
        Specified by:
        startBoolGroupList in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • endBoolGroup

        public void endBoolGroup()
                          throws IOException
        Write the end of a Bool expression list.
        Specified by:
        endBoolGroup in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • endBool

        public void endBool()
                     throws IOException
        Write the end of a Bool expression list.
        Specified by:
        endBool in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • writeLike

        public void writeLike​(String propName,
                              String val,
                              io.ebean.LikeType type,
                              boolean caseInsensitive)
                       throws IOException
        Specified by:
        writeLike in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • writeEqualTo

        public void writeEqualTo​(String propertyName,
                                 Object value)
                          throws IOException
        Write a term expression.
        Specified by:
        writeEqualTo in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • writeRange

        public void writeRange​(String propertyName,
                               String rangeType,
                               Object value)
                        throws IOException
        Write a range expression with a single value.
        Specified by:
        writeRange in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • writeRange

        public void writeRange​(String propertyName,
                               io.ebeaninternal.server.expression.Op lowOp,
                               Object valueLow,
                               io.ebeaninternal.server.expression.Op highOp,
                               Object valueHigh)
                        throws IOException
        Write a range expression with a low and high value.
        Specified by:
        writeRange in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • writeIn

        public void writeIn​(String propertyName,
                            Object[] values,
                            boolean not)
                     throws IOException
        Write a terms expression.
        Specified by:
        writeIn in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • writeIds

        public void writeIds​(Collection<?> idList)
                      throws IOException
        Write an Ids expression.
        Specified by:
        writeIds in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • writeId

        public void writeId​(Object value)
                     throws IOException
        Write an Id expression.
        Specified by:
        writeId in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • writeIEqualTo

        public void writeIEqualTo​(String propName,
                                  String value)
                           throws IOException
        Write case-insensitive equal to.
        Specified by:
        writeIEqualTo in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • writeMatch

        public void writeMatch​(String propertyName,
                               String value,
                               io.ebean.search.Match options)
                        throws IOException
        Write a prefix expression.
        Specified by:
        writeMatch in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • writeMultiMatch

        public void writeMultiMatch​(String search,
                                    io.ebean.search.MultiMatch options)
                             throws IOException
        Specified by:
        writeMultiMatch in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • writeTextSimple

        public void writeTextSimple​(String search,
                                    io.ebean.search.TextSimple options)
                             throws IOException
        Specified by:
        writeTextSimple in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • writeTextCommonTerms

        public void writeTextCommonTerms​(String search,
                                         io.ebean.search.TextCommonTerms options)
                                  throws IOException
        Specified by:
        writeTextCommonTerms in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • writeTextQueryString

        public void writeTextQueryString​(String search,
                                         io.ebean.search.TextQueryString options)
                                  throws IOException
        Specified by:
        writeTextQueryString in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • writeRaw

        public void writeRaw​(String raw,
                             Object[] values)
                      throws IOException
        Write raw JSON to the query buffer.
        Specified by:
        writeRaw in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • writeExists

        public void writeExists​(boolean notNull,
                                String propertyName)
                         throws IOException
        Write an exists expression.
        Specified by:
        writeExists in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • writeSimple

        public void writeSimple​(io.ebeaninternal.server.expression.Op type,
                                String propertyName,
                                Object value)
                         throws IOException
        Write an expression for the core operations.
        Specified by:
        writeSimple in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • startNested

        public void startNested​(String nestedPath)
                         throws IOException
        Start a nested path filter.
        Specified by:
        startNested in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • endNested

        public void endNested()
                       throws IOException
        Specified by:
        endNested in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • startNot

        public void startNot()
                      throws IOException
        Specified by:
        startNot in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException
      • endNot

        public void endNot()
                    throws IOException
        Specified by:
        endNot in interface io.ebeaninternal.server.expression.DocQueryContext
        Throws:
        IOException