Code Monkey home page Code Monkey logo

struswebservice's People

Contributors

andreasbaumann avatar patrickfrey avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

struswebservice's Issues

architecture redesign in core

Currently we use too many mutexes for things which are already synchronized in strus itself,
we don't share certain sharable objects (as the QueryProcessor) and thus have to recreate
the module functions on every query call. As the storage interface is bound to change anyway,
a major overhaul of the core architecture is needed.

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

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"}

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

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"}

bad error handling in JSON messages

cppcms json gives us only a bad_cast expection, no position, no clear indication what's
wrong. parameters which are wrong get set do a default. This is all not very user-friendly.
cppcms::json must be improved (local fork) or we use another or our own template
serialization code.

query tests are failing

The following tests FAILED:
         28 - query_in_url (Failed)
         29 - query_A (Failed)

This one seems trivial:

1c1
< {"err":{"code":4011,"msg":"cannot evaluate query, no selection features defined"},"result":"error"}

---
> {"ranklist":{"ranks":[{"attributes":[{"key":"docid","value":"doc3"},{"key":"title","value":"This is a Hello World Document"}],"docno":4,"weight":0},{"attributes":[{"key":"docid","value":"doc2"},{"key":"title","value":"This is a Hello World Document"}],"docno":2,"weight":0},{"attributes":[{"key":"docid","value":"doc1"},{"key":"title","value":"This is a Hello World Document"}],"docno":1,"weight":0}]},"result":"ok"}

Scores and weights are floats which cannot be handled by just diffing the results:

< {"ranklist":{"documents_ranked":3,"documents_visited":3,"passes_evaluated":0,"ranks":[{"attributes":[{"key":"docid","value":"doc3"}],"docno":4,"weight":5.205622073845007e-06},{"attributes":[{"key":"docid","value":"doc2"}],"docno":2,"weight":2.307670229129144e-06},{"attributes":[{"key":"docid","value":"doc1"}],"docno":1,"weight":1.110571247409098e-06}]},"result":"ok"}

---
> {"ranklist":{"ranks":[{"attributes":[{"key":"attribute","value":"doc3"}],"docno":3,"weight":1.850274916547851e-16},{"attributes":[{"key":"attribute","value":"doc2"}],"docno":2,"weight":1.850274916547851e-16},{"attributes":[{"key":"attribute","value":"doc1"}],"docno":1,"weight":1.850274916547851e-16}]},"result":"ok"}

We must demarshall the .res and the .must file and make a special comparition
operation for floats.

bad error handling in JSON messages

cppcms json gives us only a bad_cast expection, no position, no clear indication what's
wrong. parameters which are wrong get set do a default. This is all not very user-friendly.
cppcms::json must be improved (local fork) or we use another or our own template
serialization code.

architecture redesign in core

Issue by andreasbaumann
Thursday Apr 28, 2016 at 07:55 GMT
Originally opened as https://github.com/Eurospider/strusWebService/issues/13


Currently we use too many mutexes for things which are already synchronized in strus itself,
we don't share certain sharable objects (as the QueryProcessor) and thus have to recreate
the module functions on every query call. As the storage interface is bound to change anyway,
a major overhaul of the core architecture is needed.

passing features as weighting and summarizer parameters is done with heuristics

Currently we have a subtle logic how to find out whether a parameter has to be
passed as string/numeric parameter or as feature to a weighting or summarizer
function:

  • the parameter name exists in a location which is clearly expecting a feature
    (e. g. 'selection' is only accepting features)
  • we take the desciption of the function as reference

add support for metadata configuration changes

On the fly changes to the metadata configuration via HTTP protocol. Very handy when
an installation gets bigger and metadata types have to be adapted. Attributes have no
types (i.e. string only) for now and feature types are strings too, so dynamic changes
are possible implicitly.

passing features as weighting and summarizer parameters is done with heuristics

Currently we have a subtle logic how to find out whether a parameter has to be
passed as string/numeric parameter or as feature to a weighting or summarizer
function:

  • the parameter name exists in a location which is clearly expecting a feature
    (e. g. 'selection' is only accepting features)
  • we take the desciption of the function as reference

no built-in authentication

at least we should be able to provide protection for

  • queries
  • modification commands (insert, update, delete)
  • introspection
  • DDL: create, destroy indexes

delete index after inserting documents fails

2016-06-07 08:36:10; cppcms_http, info: POST /strus/index/delete/rrb (http_api.cpp:251)
strusWebService: db/version_set.cc:789: leveldb::VersionSet::~VersionSet(): Assertion `dummy_versions_.next_ == &dummy_versions_' failed.

Restarting the webservice solves the problem, after restart the index can be deleted
without any problems.

no built-in authentication

at least we should be able to provide protection for

  • queries
  • modification commands (insert, update, delete)
  • introspection
  • DDL: create, destroy indexes

summarizer names are ignored

If I set a summarizer name to "snippet" and I'm getting elements from the forward index,
I get "forward" as name of the attribute I have to fetch. This is not very logical. :-)

add support for metadata configuration changes

On the fly changes to the metadata configuration via HTTP protocol. Very handy when
an installation gets bigger and metadata types have to be adapted. Attributes have no
types (i.e. string only) for now and feature types are strings too, so dynamic changes
are possible implicitly.

passing features as weighting and summarizer parameters is done with heuristics

Issue by andreasbaumann
Saturday Apr 16, 2016 at 18:23 GMT
Originally opened as https://github.com/Eurospider/strusWebService/issues/9


Currently we have a subtle logic how to find out whether a parameter has to be
passed as string/numeric parameter or as feature to a weighting or summarizer
function:

  • the parameter name exists in a location which is clearly expecting a feature
    (e. g. 'selection' is only accepting features)
  • we take the desciption of the function as reference

architecture redesign in core

Currently we use too many mutexes for things which are already synchronized in strus itself,
we don't share certain sharable objects (as the QueryProcessor) and thus have to recreate
the module functions on every query call. As the storage interface is bound to change anyway,
a major overhaul of the core architecture is needed.

query tests are failing

The following tests FAILED:
         28 - query_in_url (Failed)
         29 - query_A (Failed)

This one seems trivial:

1c1
< {"err":{"code":4011,"msg":"cannot evaluate query, no selection features defined"},"result":"error"}

---
> {"ranklist":{"ranks":[{"attributes":[{"key":"docid","value":"doc3"},{"key":"title","value":"This is a Hello World Document"}],"docno":4,"weight":0},{"attributes":[{"key":"docid","value":"doc2"},{"key":"title","value":"This is a Hello World Document"}],"docno":2,"weight":0},{"attributes":[{"key":"docid","value":"doc1"},{"key":"title","value":"This is a Hello World Document"}],"docno":1,"weight":0}]},"result":"ok"}

Scores and weights are floats which cannot be handled by just diffing the results:

< {"ranklist":{"documents_ranked":3,"documents_visited":3,"passes_evaluated":0,"ranks":[{"attributes":[{"key":"docid","value":"doc3"}],"docno":4,"weight":5.205622073845007e-06},{"attributes":[{"key":"docid","value":"doc2"}],"docno":2,"weight":2.307670229129144e-06},{"attributes":[{"key":"docid","value":"doc1"}],"docno":1,"weight":1.110571247409098e-06}]},"result":"ok"}

---
> {"ranklist":{"ranks":[{"attributes":[{"key":"attribute","value":"doc3"}],"docno":3,"weight":1.850274916547851e-16},{"attributes":[{"key":"attribute","value":"doc2"}],"docno":2,"weight":1.850274916547851e-16},{"attributes":[{"key":"attribute","value":"doc1"}],"docno":1,"weight":1.850274916547851e-16}]},"result":"ok"}

We must demarshall the .res and the .must file and make a special comparition
operation for floats.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.