sirensolutions / siren-join

[This is the old, single node version for Elasticsearch 2.x, see the latest "Siren Federate" plugin for distributed Elasticsearch 5.x and 6.x capabilities]
http://siren.io
GNU Affero General Public License v3.0
183 stars 60 forks source link

Avoid index_not_found_exception when missing index #110

Open dasansol92 opened 8 years ago

dasansol92 commented 8 years ago

When I make an elastic request on multiple indices I can activate the ignore_unavailable param to avoid unexisting indices (ref: https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-index.html#multi-index). Is it possible to avoid this error "index_not_found_exception" when I'm doing filterjoin query on an unexisting index?

dasansol92 commented 7 years ago

hello @rendel , can you provide some feedback on this? Thanks in advance!

rendel commented 7 years ago

Hi @dasansol92 can you please give an example with a request, and the version of siren-join you are using. Thanks.

dasansol92 commented 7 years ago

@rendel This is a query example:

{
    "query": {
        "bool": {
            "filter": [{
                "filterjoin": {
                    "id": {
                        "types": "document",
                        "query": {
                            "bool": {
                                "filter": [{
                                    "query_string": {
                                        "fields": [
                                            "content",
                                            "title"
                                        ],
                                        "query": "test",
                                        "default_operator": "AND"
                                    }
                                }, {
                                    "query_string": {
                                        "query": "+publication_date:([2016-08-22T23:59:59.999Z TO 2016-11-22T23:59:59.999Z])",
                                        "default_operator": "AND"
                                    }
                                }]
                            }
                        },
                        "path": "documents_ids",
                        "indices": [
                            "documents_201608",
                            "documents_201609",
                            "documents_201610",
                            "documents_201611"
                        ]
                    }
                }
            }]
        }
    }
}

We generate the indices dynamically and could be that one of this not exist.

We use ES 2.3.3 and siren-join 2.3.3

rendel commented 7 years ago

We would need to extend the GetIndicesVersion action, and probably the TermsByQuery action to support the option ignore_unavailable. Unfortunately, I am under time constraint as I am focusing a new version of the siren plugin and I can't right now invest some time fixing this issue.

dasansol92 commented 7 years ago

Okey @rendel, thanks for the answer!