patrickfrey / strusWebService

web service (HTTP/JSON) to use the strus API as a service
http://project-strus.net
Mozilla Public License 2.0
4 stars 0 forks source link

creating a storage with illegal metadata configuration creates an index without metadata #45

Closed andreasbaumann closed 6 years ago

andreasbaumann commented 6 years ago

The web service configuration contains:

"metadata" : [
                                        { "name" : "doclen", "type" : "UInt16" },
                                        { "name" : "docweight", "type" : "Float32" },
                                        { "name" : "date", "type" : "UInt16x" }
                        ]

an illegal type Uint16x.

Creating an index yields:

curl -XPOST -H 'Content-Type: application/json' -d '{ "params" : {} }' http://localhost:8080/strus/index/create/A
{"result":"ok"}

No error message!

Also in the log I see:

2016-05-20 13:48:59; strusWebService, debug: Storage config string: database=leveldb; path=./storage/B; compression=yes; cache=8388608; max_open_files=1000; write_buffer_size=4194304; block_size=4096; metadata=doclen UInt16, docweight Float32, date UInt16x (strusWebService.cpp:381)
2016-05-20 13:48:59; strusWebService, debug: Simple storage config string: path=./storage/B (strusWebService.cpp:394)

No indication of errors.

The indexes have been created:

shell> curl http://localhost:8080/strus/index/list
{"indexes":["A","B"],"result":"ok"}

Getting the configuration of the index yields:

curl http://localhost:8080/strus/index/config/A
{"err":{"code":2404,"msg":"error creating storage client: error creating storage client: corrupt storage, not all mandatory variables defined"},"result":"error"}
andreasbaumann commented 6 years ago

This relates to https://github.com/patrickfrey/strus/issues/60

patrickfrey commented 6 years ago

Issue strus/#60 has been fixed.