Class ElasticTaskService

    • Field Detail

      • template

        protected org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate template
      • taskIndex

        @Value("${spring.data.elasticsearch.index.task}")
        protected java.lang.String taskIndex
      • elasticsearchTemplate

        @Autowired
        protected org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate elasticsearchTemplate
      • fullTextFieldMap

        protected java.util.Map<java.lang.String,​java.lang.Float> fullTextFieldMap
      • caseTitledMap

        protected java.util.Map<java.lang.String,​java.lang.Float> caseTitledMap
    • Constructor Detail

      • ElasticTaskService

        @Autowired
        public ElasticTaskService​(org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate template)
    • Method Detail

      • setTaskService

        @Autowired
        @Lazy
        public void setTaskService​(ITaskService taskService)
      • fullTextFields

        public java.util.Map<java.lang.String,​java.lang.Float> fullTextFields()
        See QueryStringQueryBuilder.fields(Map)
        Specified by:
        fullTextFields in interface IElasticTaskService
        Returns:
        map where keys are ElasticCase field names and values are boosts of these fields
      • buildQuery

        protected org.springframework.data.elasticsearch.core.query.NativeSearchQuery buildQuery​(java.util.List<ElasticTaskSearchRequest> requests,
                                                                                                 LoggedUser user,
                                                                                                 org.springframework.data.domain.Pageable pageable,
                                                                                                 java.util.Locale locale,
                                                                                                 java.lang.Boolean isIntersection)
      • buildSingleQuery

        protected org.elasticsearch.index.query.BoolQueryBuilder buildSingleQuery​(ElasticTaskSearchRequest request,
                                                                                  LoggedUser user,
                                                                                  java.util.Locale locale)
      • buildCaseQuery

        protected void buildCaseQuery​(ElasticTaskSearchRequest request,
                                      org.elasticsearch.index.query.BoolQueryBuilder query)
        Tasks of case with id "5cb07b6ff05be15f0b972c4d" { "case": { "id": "5cb07b6ff05be15f0b972c4d" } }

        Tasks of cases with id "5cb07b6ff05be15f0b972c4d" OR "5cb07b6ff05be15f0b972c4e" { "case": [{ "id": "5cb07b6ff05be15f0b972c4d" }, { "id": "5cb07b6ff05be15f0b972c4e" }] }

        Tasks of case with case title containing "foo" { "case": { "title": "foo" } }

        Tasks of case with case title containing "foo" OR "bar" { "case": [{ "title": "foo" }, { "title: "bar" }] }

      • caseRequestQuery

        protected org.elasticsearch.index.query.QueryBuilder caseRequestQuery​(TaskSearchCaseRequest caseRequest)
        Returns:
        query for ID if only ID is present. Query for title if only title is present. If both are present an ID query is returned. If neither are present null is returned.
      • buildTitleQuery

        protected void buildTitleQuery​(ElasticTaskSearchRequest request,
                                       org.elasticsearch.index.query.BoolQueryBuilder query)
        Tasks with title (default value) "New task" { "title": "New task" }

        Tasks with title (default value) "New task" OR "Status" { "title": [ "New task", "Status" ] }

      • buildUserQuery

        protected void buildUserQuery​(ElasticTaskSearchRequest request,
                                      org.elasticsearch.index.query.BoolQueryBuilder query)
        Tasks assigned to user with id 1 { "user": 1 }

        Tasks assigned to user with id 1 OR 2

      • buildProcessQuery

        protected void buildProcessQuery​(ElasticTaskSearchRequest request,
                                         org.elasticsearch.index.query.BoolQueryBuilder query)
        Tasks of process "document" { "process": "document" }

        Tasks of process "document" OR "folder" { "process": [ "document", "folder", ] }

      • buildFullTextQuery

        protected void buildFullTextQuery​(ElasticTaskSearchRequest request,
                                          org.elasticsearch.index.query.BoolQueryBuilder query)
        Full text search on fields defined by fullTextFields().
      • buildTransitionQuery

        protected void buildTransitionQuery​(ElasticTaskSearchRequest request,
                                            org.elasticsearch.index.query.BoolQueryBuilder query)
        Tasks with transition id "document" { "transitionId": "document" }

        Tasks with transition id "document" OR "folder" { "transitionId": [ "document", "folder", ] }

      • buildGroupQuery

        public boolean buildGroupQuery​(TaskSearchRequest request,
                                       LoggedUser user,
                                       java.util.Locale locale,
                                       org.elasticsearch.index.query.BoolQueryBuilder query)
        Tasks of cases of group with id "5cb07b6ff05be15f0b972c4d" { "group": "5cb07b6ff05be15f0b972c4d" }

        Tasks of cases of group with id "5cb07b6ff05be15f0b972c4d" OR "5cb07b6ff05be15f0b972c4e" { "transitionId": [ "5cb07b6ff05be15f0b972c4d", "5cb07b6ff05be15f0b972c4e", ] }