ragflow icon indicating copy to clipboard operation
ragflow copied to clipboard

[Question]: BadRequestError

Open lingzhi42166 opened this issue 9 months ago • 6 comments

When opening the page to view and analyze the data set (that is, when requesting the url http://localhost/v1/chunk/list), the following error is returned:

{
    "error": {
        "root_cause": [
            {
                "type": "illegal_argument_exception",
                "reason": "Fielddata is disabled on [create_time] in [ragflow_50a01de202ee11ef915d0242ac120002]. Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [create_time] in order to load field data by uninverting the inverted index. Note that this can use significant memory."
            }
        ],
        "type": "search_phase_execution_exception",
        "reason": "all shards failed",
        "phase": "query",
        "grouped": true,
        "failed_shards": [
            {
                "shard": 0,
                "index": "ragflow_50a01de202ee11ef915d0242ac120002",
                "node": "OAM8RRqrRjWF3-4v3XuIRQ",
                "reason": {
                    "type": "illegal_argument_exception",
                    "reason": "Fielddata is disabled on [create_time] in [ragflow_50a01de202ee11ef915d0242ac120002]. Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [create_time] in order to load field data by uninverting the inverted index. Note that this can use significant memory."
                }
            }
        ],
        "caused_by": {
            "type": "illegal_argument_exception",
            "reason": "Fielddata is disabled on [create_time] in [ragflow_50a01de202ee11ef915d0242ac120002]. Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [create_time] in order to load field data by uninverting the inverted index. Note that this can use significant memory.",
            "caused_by": {
                "type": "illegal_argument_exception",
                "reason": "Fielddata is disabled on [create_time] in [ragflow_50a01de202ee11ef915d0242ac120002]. Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [create_time] in order to load field data by uninverting the inverted index. Note that this can use significant memory."
            }
        }
    },
    "status": 400
}

Raw error log as follows:

BadRequestError('search_phase_execution_exception', meta=ApiResponseMeta(status=400, http_version='1.1', headers={'X-elastic-product': 'Elasticsearch', 'content-type': 'application/vnd.elasticsearch+json;compatible-with=8', 'content-length': '2231'}, duration=0.007349252700805664, node=NodeConfig(scheme='http', host='es01', port=9200, path_prefix='', headers={'user-agent': 'elasticsearch-py/8.12.1 (Python/3.11.0; elastic-transport/8.12.0)'}, connections_per_node=10, request_timeout=10.0, http_compress=False, verify_certs=True, ca_certs=None, client_cert=None, client_key=None, ssl_assert_hostname=None, ssl_assert_fingerprint=None, ssl_version=None, ssl_context=None, ssl_show_warn=True, _extras={})), body={'error': {'root_cause': [{'type': 'illegal_argument_exception', 'reason': 'Fielddata is disabled on [create_time] in [ragflow_50a01de202ee11ef915d0242ac120002]. Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [create_time] in order to load field data by uninverting the inverted index. Note that this can use significant memory.'}], 'type': 'search_phase_execution_exception', 'reason': 'all shards failed', 'phase': 'query', 'grouped': True, 'failed_shards': [{'shard': 0, 'index': 'ragflow_50a01de202ee11ef915d0242ac120002', 'node': 'OAM8RRqrRjWF3-4v3XuIRQ', 'reason': {'type': 'illegal_argument_exception', 'reason': 'Fielddata is disabled on [create_time] in [ragflow_50a01de202ee11ef915d0242ac120002]. Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [create_time] in order to load field data by uninverting the inverted index. Note that this can use significant memory.'}}], 'caused_by': {'type': 'illegal_argument_exception', 'reason': 'Fielddata is disabled on [create_time] in [ragflow_50a01de202ee11ef915d0242ac120002]. Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [create_time] in order to load field data by uninverting the inverted index. Note that this can use significant memory.', 'caused_by': {'type': 'illegal_argument_exception', 'reason': 'Fielddata is disabled on [create_time] in [ragflow_50a01de202ee11ef915d0242ac120002]. Text fields are not optimised for operations that require per-document field data like aggregations and sorting, so these operations are disabled by default. Please use a keyword field instead. Alternatively, set fielddata=true on [create_time] in order to load field data by uninverting the inverted index. Note that this can use significant memory.'}}}, 'status': 400})

lingzhi42166 avatar Apr 25 '24 10:04 lingzhi42166

Could you share a sample of your file?

KevinHuSh avatar Apr 25 '24 11:04 KevinHuSh

Could you share a sample of your file? 我上传的是word文件,内容如下(我在https://demo.ragflow.io/上传同样的文件是可以正常解析并返回的): 23.3 切割作业 23.3.1 点火时应先开乙炔阀、后开氧气阀,嘴孔不得对人;熄火时顺 序相反。发生回火或爆鸣时,应先关乙炔阀,再关氧气阀。 23.3.2 使用中的氧气瓶和乙炔气瓶应垂直固定放置,氧气瓶和乙炔气 23.3.3 气瓶不得靠近热源或在烈日下曝晒。乙炔气瓶使用时必须直立 放置,禁止卧放使用。

lingzhi42166 avatar Apr 25 '24 11:04 lingzhi42166

Thanks for your response,I have try to create an empty file in knowledgebase,but also return same BadRequestError when I open the file

lingzhi42166 avatar Apr 25 '24 14:04 lingzhi42166

@lingzhi42166 We intend to create an international community, so we encourage using English for questions and answers to help others with similar queries. 😊

For your question, would please attach the sample file in the issue?

And the error log isn't formatted, which is hard to recognize. May be you can find a tool to format it.

JinHai-CN avatar Apr 25 '24 15:04 JinHai-CN

@lingzhi42166 We intend to create an international community, so we encourage using English for questions and answers to help others with similar queries. 😊

For your question, would please attach the sample file in the issue?

And the error log isn't formatted, which is hard to recognize. May be you can find a tool to format it.

Thanks for your suggestion,I have formatted my error log and attach sample file. test.docx

lingzhi42166 avatar Apr 26 '24 01:04 lingzhi42166

I didn't reproduce the case using this file. What about new another knowledge base and upload file? image

KevinHuSh avatar Apr 28 '24 06:04 KevinHuSh